Type.GetArrayRank() Method is used to get the number of dimensions in an array.
Syntax: public virtual int GetArrayRank ();
Return Value: This method returns an integer which contains the number of dimensions in the current type.
Exception: This method throws ArgumentException if the current type is not an array.
Below programs illustrate the use of Type.GetArrayRank() Method:
ArrayRank is: 6
The current type is not an Array Exception Thrown: System.ArgumentException
- Difference between Method Overriding and Method Hiding in C#
- C# | Math.Min() Method
- C# | CopyTo() Method
- TimeSpan.Add() Method in C#
- C# | Method Overriding
- C# | Trim() Method
- C# | Remove() Method
- Main Method in C#
- C# | IndexOfAny() Method
- Decimal.Add() Method in C#
- C# | Insert() Method
- C# | Replace() Method
- C# | Math.Max() Method
- Stack.Contains() Method in C#
- C# | Uri.IsHexEncoding() Method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.