The method decimal[,] GetUpperBound returns an array of integers with the upper bounds of each dimension of a decimal multidimensional array.
Example 1:
decimal[,] arr = new decimal[5,5]; int[] upperBounds = arr.GetUpperBound(0); Console.WriteLine(upperBounds[0]); // Output: 4 // This example shows how to get the upper bound of the first dimension of the array. The output is 4 because the size of the first dimension is 5, but the index starts at 0.
Example 2:
decimal[,] arr = new decimal[3,4]; int[] upperBounds = arr.GetUpperBound(1); Console.WriteLine(upperBounds[0]); // Output: 3 // This example shows how to get the upper bound of the second dimension of the array. The output is 3 because the size of the second dimension is 4, but the index starts at 0.
These examples use the System.Array package library.
C# (CSharp) decimal[,].GetUpperBound - 17 examples found. These are the top rated real world C# (CSharp) examples of decimal[,].GetUpperBound extracted from open source projects. You can rate examples to help us improve the quality of examples.