length list c# code example
Example 1: c sharp list length
// To get the length of a List use 'List<T>.Count'
List<string> stringList = new List<string>{"string1", "string2"};
stringList.Count
// Output:
// 2
Example 2: get list length c#
public List<int> values;
public int listLength;
listLength = values.Count;
Example 3: how to find length of list c#
list.Count // pretty simple
Example 4: c# list length
List<int> list = new List<int>() {7,5,1,4 };
Example 5: c# how to get length of string list
list.Length // list represents the name of your list