List<T> Members
.NET Framework 3.5
Represents a strongly typed list of objects that can be accessed by index. Provides methods to search, sort, and manipulate lists.
The List<T> type exposes the following members.
| Name | Description | |
|---|---|---|
|
Add | Adds an object to the end of the List<T>. |
|
AddRange | Adds the elements of the specified collection to the end of the List<T>. |
|
AsReadOnly | Returns a read-only IList<T> wrapper for the current collection. |
|
BinarySearch | Overloaded. Uses a binary search algorithm to locate a specific element in the sorted List<T> or a portion of it. |
|
Clear | Removes all elements from the List<T>. |
|
Contains | Determines whether an element is in the List<T>. |
|
ConvertAll<TOutput> | Converts the elements in the current List<T> to another type, and returns a list containing the converted elements. |
|
CopyTo | Overloaded. Copies the List<T> or a portion of it to an array. |
|
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
|
Exists | Determines whether the List<T> contains elements that match the conditions defined by the specified predicate. |
|
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
|
Find | Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire List<T>. |
|
FindAll | Retrieves all the elements that match the conditions defined by the specified predicate. |
|
FindIndex | Overloaded. Searches for an element that matches the conditions defined by a specified predicate, and returns the zero-based index of the first occurrence within the List<T> or a portion of it. |
|
FindLast | Searches for an element that matches the conditions defined by the specified predicate, and returns the last occurrence within the entire List<T>. |
|
FindLastIndex | Overloaded. Searches for an element that matches the conditions defined by a specified predicate, and returns the zero-based index of the last occurrence within the List<T> or a portion of it. |
|
ForEach | Performs the specified action on each element of the List<T>. |
|
GetEnumerator | Returns an enumerator that iterates through the List<T>. |
|
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
|
GetRange | Creates a shallow copy of a range of elements in the source List<T>. |
|
GetType | Gets the type of the current instance. (Inherited from Object.) |
|
IndexOf | Overloaded. Returns the zero-based index of the first occurrence of a value in the List<T> or in a portion of it. |
|
Insert | Inserts an element into the List<T> at the specified index. |
|
InsertRange | Inserts the elements of a collection into the List<T> at the specified index. |
|
LastIndexOf | Overloaded. Returns the zero-based index of the last occurrence of a value in the List<T> or in a portion of it. |
|
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
|
Remove | Removes the first occurrence of a specific object from the List<T>. |
|
RemoveAll | Removes all the elements that match the conditions defined by the specified predicate. |
|
RemoveAt | Removes the element at the specified index of the List<T>. |
|
RemoveRange | Removes a range of elements from the List<T>. |
|
Reverse | Overloaded. Reverses the order of the elements in the List<T> or a portion of it. |
|
Sort | Overloaded. Sorts the elements in the List<T> or a portion of it. |
|
ToArray | Copies the elements of the List<T> to a new array. |
|
ToString | Returns a string that represents the current object. (Inherited from Object.) |
|
TrimExcess | Sets the capacity to the actual number of elements in the List<T>, if that number is less than a threshold value. |
|
TrueForAll | Determines whether every element in the List<T> matches the conditions defined by the specified predicate. |
| Name | Description | |
|---|---|---|
|
Aggregate | Applies an accumulator function over a sequence. (Defined by Enumerable.) |
|
All | Determines whether all elements of a sequence satisfy a condition. (Defined by Enumerable.) |
|
Any | Overloaded. Determines whether any element of a sequence exists or satisfies a condition. |
|
AsEnumerable | Returns the input typed as IEnumerable<T>. (Defined by Enumerable.) |
|
AsQueryable | Overloaded. Converts an IEnumerable or generic IEnumerable<T> to an IQueryable or generic IQueryable<T>. |
|
Average | Overloaded. Computes the average of a sequence of numeric values. |
|
Cast | Converts the elements of an IEnumerable to the specified type. (Defined by Enumerable.) |
|
Concat | Concatenates two sequences. (Defined by Enumerable.) |
|
Contains | Overloaded. Determines whether a sequence contains a specified element. |
|
Count | Overloaded. Returns the number of elements in a sequence. |
|
DefaultIfEmpty | Overloaded. Returns the elements of an IEnumerable<T>, or a default valued singleton collection if the sequence is empty. |
|
Distinct | Overloaded. Returns distinct elements from a sequence. |
|
ElementAt | Returns the element at a specified index in a sequence. (Defined by Enumerable.) |
|
ElementAtOrDefault | Returns the element at a specified index in a sequence or a default value if the index is out of range. (Defined by Enumerable.) |
|
Except | Overloaded. Produces the set difference of two sequences. |
|
First | Overloaded. Returns the first element of a sequence. |
|
FirstOrDefault | Overloaded. Returns the first element of a sequence, or a default value if no element is found. |
|
Intersect | Overloaded. Produces the set intersection of two sequences. |
|
Last | Overloaded. Returns the last element of a sequence. |
|
LastOrDefault | Overloaded. Returns the last element of a sequence, or a default value if no element is found. |
|
LongCount | Overloaded. Returns an Int64 that represents the number of elements in a sequence. |
|
Max | Overloaded. Returns the maximum value in a sequence of values. |
|
Min | Overloaded. Returns the minimum value in a sequence of values. |
|
OfType | Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.) |
|
Reverse | Inverts the order of the elements in a sequence. (Defined by Enumerable.) |
|
SequenceEqual | Overloaded. Determines whether two sequences are equal according to an equality comparer. |
|
Single | Overloaded. Returns a single, specific element of a sequence of values. |
|
SingleOrDefault | Overloaded. Returns a single, specific element of a sequence of values, or a default value if no such element is found. |
|
Skip | Bypasses a specified number of elements in a sequence and then returns the remaining elements. (Defined by Enumerable.) |
|
SkipWhile | Overloaded. Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. |
|
Sum | Overloaded. Computes the sum of a sequence of numeric values. |
|
Take | Returns a specified number of contiguous elements from the start of a sequence. (Defined by Enumerable.) |
|
TakeWhile | Overloaded. Returns elements from a sequence as long as a specified condition is true, and then skips the remaining elements. |
|
ToArray | Creates an array from a IEnumerable<T>. (Defined by Enumerable.) |
|
ToList | Creates a List<T> from an IEnumerable<T>. (Defined by Enumerable.) |
|
Union | Overloaded. Produces the set union of two sequences. |
|
Where | Overloaded. Filters a sequence of values based on a predicate. |
| Name | Description | |
|---|---|---|
|
IList.Add | Adds an item to the IList. |
|
IList.Contains | Determines whether the IList contains a specific value. |
|
ICollection.CopyTo | Copies the elements of the ICollection to an Array, starting at a particular Array index. |
|
IEnumerable<T>.GetEnumerator | Returns an enumerator that iterates through a collection. |
|
IEnumerable.GetEnumerator | Returns an enumerator that iterates through a collection. |
|
IList.IndexOf | Determines the index of a specific item in the IList. |
|
IList.Insert | Inserts an item to the IList at the specified index. |
|
IList.IsFixedSize | Gets a value indicating whether the IList has a fixed size. |
|
ICollection<T>.IsReadOnly | Gets a value indicating whether the ICollection<T> is read-only. |
|
IList.IsReadOnly | Gets a value indicating whether the IList is read-only. |
|
ICollection.IsSynchronized | Gets a value indicating whether access to the ICollection is synchronized (thread safe). |
|
IList.Item | Gets or sets the element at the specified index. |
|
IList.Remove | Removes the first occurrence of a specific object from the IList. |
|
ICollection.SyncRoot | Gets an object that can be used to synchronize access to the ICollection. |