System.Collections.Generic.List<T>.Clear Method
Removes all elements from the list.

Syntax

public void Clear ()

Remarks

ICollection<T>.Count gets set to zero, and references to other objects from elements of the collection are also released. The capacity remains unchanged.

Note:

To reset the capacity, call List<T>.TrimToSize or set the List<T>.Capacity property directly.

Requirements

Namespace: System.Collections.Generic
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0