length of a list c# code example
Example 1: c sharp list length
List<string> stringList = new List<string>{"string1", "string2"};
stringList.Count
Example 2: c# list length
using System;
using System.Collections.Generic;
List<int> list = new List<int>() {7,5,1,4 };
int listLenght = list.Count;
Console.WriteLine(listLenght);
Example 3: get list length c#
public List<int> values;
public int listLength;
listLength = values.Count;
Example 4: c# list length
List<int> list = new List<int>() {7,5,1,4 };