How to

get length of an array

Published: 14. October 2011 | Updated: 26. October 2011
License: Microsoft Public License (MS-PL)
Categories: Framework » Arrays
Tags: Array C#
Was this snippet helpful for you? YESYES / NONO
int[] array = new int[] { 1, 2, 3, 4, 5, 6 };
int length = array.Length;

Console.WriteLine(length);
Console Output:
6
Send us feedback about this snippet »



Related Snippets: