If you want to know how many items are in the list, use the Count property.
int numElements = list.Count;
On the other hand, if you want to know how many items the List<T> backup store stores, then use the Capacity property.
int size = list.Capacity;
Jaredpar
source share