-2

I have an array:

 string[,] array = new string[5, 24];

I want to get the length/size of the first array = "5".

Joe Doe
  • 159
  • 1
  • 8

1 Answers1

-1

5 is the length of the 0th dimension. GetLength() will give you the result - you just have to pass the dimension

string[,] array = new string[5, 24];
int result = array.GetLength(0); //5
fubo
  • 44,811
  • 17
  • 103
  • 137