Clear Method

CollectionBase.Clear Method ()

 

Removes all objects from the CollectionBase instance. This method cannot be overridden.

Namespace:   System.Collections
Assembly:  mscorlib (in mscorlib.dll)

public void Clear()

Implements

IList.Clear()

Count is set to zero.

This method is an O(n) operation, where n is Count.

To perform custom actions before or after the collection is cleared, override the protected OnClear or OnClearComplete method.

Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Return to top
Show:
© 2016 Microsoft