 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How do you find the length of an array in C#?
To find the length of an array, use the Array.Length() method.
Example
Let us see an example −
using System; class Program {    static void Main(){       int[] arr = new int[10];       // finding length       int arrLength = arr.Length;       Console.WriteLine("Length of the array: "+arrLength);    } }  Output
Length of the array: 10
Above, we have an array −
int[] arr = new int[10];
Now to find the length, we used the Length() method −
int arrLength = arr.Length;
Advertisements
 