The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IList.Clear Method

When implemented by a class, removes all items from the IList.

[Visual Basic]
Sub Clear()
void Clear();
void Clear();
function Clear();


Exception Type Condition
NotSupportedException The IList is read-only.


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. The capacity can be set to zero or a default value, or it can remain unchanged.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

IList Interface | IList Members | System.Collections Namespace

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft