System.Collections.IList.Clear Method

Removes all items from the IList.

Syntax

public void Clear ()

Exceptions

TypeReason
NotSupportedExceptionThe current instance is read-only.

Remarks

Implementations of this method can vary in how they handle the ICollection.Count and the capacity of a collection. Typically, the count is set to zero, and references to other objects from elements of the collection are also released. The capacity can be set to zero or a default value, or it can remain unchanged.

Requirements

Namespace: System.Collections
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0