Mono Class Library: System.Array Overview | Members

System.Array.GetUpperBound Method

Returns the upper bound of the specified dimension in the current instance. [Edit]

[System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)]
public int GetUpperBound (int dimension)

Parameters

dimension
A int that contains the zero-based dimension of the current instance whose upper bound is to be determined. [Edit]

Returns

A int that contains the upper bound of the specified dimension in the current instance. [Edit]

Exceptions

TypeReason
IndexOutOfRangeException

dimension < 0.

-or-

dimension is equal to or greater than the Array.Rank property of the current instance.

[Edit]

Remarks

Note: For example, Array.GetUpperBound(int) (0) returns the upper bound of the first dimension of the current instance, and Array.GetUpperBound(int)(Array.Rank - 1) returns the upper bound of the last dimension of the current instance.
[Edit]

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0