Find length of the multi dimensional Array in .Net

By Santhosh N

This explains how to find the length of the Array elements in multi dimensional array dimension wise.

C# Array has a method by the name, GetLength which returns the number of the elements in the specified dimension of the multi-dimensional array.

Syntax: GetLength(n)

Here n is the dimension which should be greater than or equal to 0 and less than or equal to the Rank of the array. Otherwise, IndexOutOfRange exception is thrown.

Ex1: GetLength(0) returns the number of elements in 0 dimension, i.e, first dimension of the array

Related FAQs

This is how you can check if the given string is in numeric format or not in c#
At times we do encounter problems with few dialogs in visual studio or we see visual studio not responding few options
This explains how to find the length of the string in oracle
Find length of the multi dimensional Array in .Net  (2381 Views)