.NET Framework 4.6 and 4.5
Gets a 32-bit integer that represents the number of elements in the specified dimension of the Array.
member GetLength :
dimension:int -> int
- Type: System.Int32
A zero-based dimension of the Array whose length needs to be determined.
Type: System.Int32A 32-bit integer that represents the number of elements in the specified dimension.
An example of GetLength is GetLength(0), which returns the number of elements in the first dimension of the Array.
This method is an O(1) operation.
The following example shows how to use GetLength to display the dimensions of two arrays with different ranks.
No code example is currently available or this language may not be supported.
Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1
.NET Framework Client Profile
Supported in: 4, 3.5 SP1
Supported in: 3.0, 2.0, 1.0
.NET for Windows Phone apps
Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8
Portable Class Library
Supported in: Portable Class Library