Skip to content
C#

System.Collections.Generic.List<T> API Reference

C# List<T> — a strongly-typed, dynamically-resizable list backed by an internal array.

By EZ4Code Team

List<T>

Represents a strongly typed list of objects that can be accessed by index. Provides methods to search, sort, and manipulate lists.

List<T>.Add(T item)

Adds an object to the end of the List<T>.

Returns: void

List<T>.Count -> int

Gets the number of elements contained in the List<T>.

Returns: int

List<T>.Remove(T item) -> bool

Removes the first occurrence of a specific object. Returns true if item was successfully removed.

Returns: bool

List<T>.Contains(T item) -> bool

Determines whether an element is in the List<T>.

Returns: bool

List<T>.Sort()

Sorts the elements in the entire List<T> using the default comparer.

Returns: void

List<T>.ToArray() -> T[]

Copies the elements of the List<T> to a new array.

Returns: T[]

List<T>.Find(Predicate<T> match) -> T

Searches for an element that matches the conditions defined by the specified predicate.

Returns: T

More C# API References