ArrayLength Method
TOC
Collapse the table of content
Expand the table of content

Expression.ArrayLength Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Creates a UnaryExpression that represents an expression for obtaining the length of a one-dimensional array.

Namespace:  System.Linq.Expressions
Assembly:  System.Core (in System.Core.dll)

'Declaration
Public Shared Function ArrayLength ( _
	array As Expression _
) As UnaryExpression

Parameters

array
Type: System.Linq.Expressions.Expression
An Expression to set the Operand property equal to.

Return Value

Type: System.Linq.Expressions.UnaryExpression
A UnaryExpression that has the NodeType property equal to ArrayLength and the Operand property equal to array.

ExceptionCondition
ArgumentNullException

array is Nothing.

ArgumentException

array.Type does not represent an array type.

The Type property of array must represent an array type.

The Type property of the resulting UnaryExpression is equal to Int32. The Method property is Nothing, and both IsLifted and IsLiftedToNull are set to false.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft