asp.net.ph

Array.GetLength Method

System Namespace   Array Class


Returns the number of elements in the specified dimension of the Array.

[ VB ]
<Serializable>
Public Function GetLength ( _
   ByVal dimension As Integer _
) As Integer

[ C# ]
[Serializable]
public int GetLength (
   int dimension
);

[ C++ ]
[Serializable]
public: int GetLength (
   int dimension
);

[JScript ]
public Serializable
function GetLength (
   dimension : int
) : int;

Parameters

dimension
A zero-based dimension of the Array whose length needs to be determined.

Return Value

The number of elements in the specified dimension.

Exceptions


Exception Type Condition
IndexOutOfRangeException dimension is less than zero.

-or-

dimension is equal to or greater than Rank.


Remarks

An example of GetLength is GetLength ( 0 ), which returns the number of elements in the first dimension of the Array.

See Also

Array Members   Length   ICollection.Count   Rank Skip Navigation Links


Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note