The index of the last element of the specified dimension in the array, or -1 if the specified dimension is empty.
Type Reason IndexOutOfRangeException dimension < 0.
-or-
dimension is equal to or greater than the Array.Rank property of the current instance.
GetUpperBound(0) returns the last index in the first dimension of the array, and GetUpperBound(Rank - 1) returns the last index of the last dimension of the array.
This method is an O(1) operation.