GetUpperBound
GetUpperBound is a method of the System.Array class in the .NET framework and .NET Core. It returns the upper bound, i.e., the largest valid index, for a specified dimension of a multidimensional array.
Signature and usage: int GetUpperBound(int dimension). The dimension parameter is zero-based and must be in the
Return value and behavior: GetUpperBound returns the upper bound for the given dimension. If the length of
Exceptions and constraints: If dimension is less than 0 or greater than or equal to Rank, GetUpperBound
Related concepts: GetLowerBound(int dimension) returns the corresponding lower bound for a dimension (often 0 in .NET),
Overview: GetUpperBound is commonly used in loops and array-processing code to determine the last valid index