get list length c#

C#
public List<int> values;
public int listLength;

listLength = values.Count;// To get the length of a List use 'List<T>.Count'
List<string> stringList = new List<string>{"string1", "string2"};
stringList.Count
// Output:
// 2
Source

Also in C#: