CollectionBase.Clear Method ()

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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: