See Also: List<T> Members
- T
- Documentation for this section has not yet been entered.
Some methods, such as Contains, IndexOf, LastIndexOf, and Remove, use an equality comparer for the list elements. The default equality comparer for type T is determined as follows: If type T implements IEquatable<T> then the default equality comparer is IEquatable;T>.Equals(T); otherwise the default equality comparer is object.Equals(Object).
Some methods, such as BinarySearch and Sort, use a comparer for the list elements. Some overloads of these methods take an explicit comparer as argument, while others use a default comparer. The default comparer for type T is determined as follows: If type T implements System.IComparable<T> then the default comparer is IComparable<T>.CompareTo(T); otherwise, if type T implements IComparable then the default comparer is IComparable.CompareTo(Object). If type T implements neither IComparable<T> nor IComparable then there is no default comparer; in this case a comparer or comparison delegate must be given explicitly.
The capacity of a List<T> is the number of elements the List<T> can hold. As elements are added to a List<T>, the capacity is automatically increased as required.. The capacity can be decreased by calling List<T>.TrimToSize or by setting the List<T>.Capacity property explicitly.
Indexes in this collection are zero-based.
List<T> accepts null as a valid value for reference types and allows duplicate elements.
This type contains a member that is a nested type, called Enumerator. Although Enumerator is a member of this type, Enumerator is not described here; instead, it is described in its own entry, List<T>.Enumerator.