How do you use the Array.GetLength function in C#?
What is the difference between the Length property and the GetLength functi
The .Length property returns the number of elements in an array, whether it be one dimensional or multidimensional. That is a 2x6 array will have length of 12.
The .GetLength(0) method returns number of elements in the row direction in a multidimensional array. For a 2x6 array that is 2.
The .GetLength(1) method returns number of elements in the column direction in a multidimensional array. For a 2x6 array that is 6.
These do not return an actual element value, as stated by the chosen answer above.