length of array c# code example
Example 1: c# length of array
string[] weekDays;
weekDays = new string[] {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
Console.Write(weekDays.Length);
Example 2: length of arr c#
string[] arr = {"foo", "bar"}
Console.WriteLine(arr.Length);
Example 3: how to declare an array lenght in c#
public int[] number = new int[2 ];
int[1 ] = 69;
Example 4: c# array lenght
int arraylenght = YourArray.Length;
Example 5: how to get an arrays length in c#
int array[] array;
int index;
public void func(){
for(int i; i < array.Length;i++){
index++;
}
Console.Write(index);
}