Export (0) Print
Expand All

Array.IList.Clear Method

.NET Framework 1.1

Sets all elements in the Array to zero, to false, or to a null reference (Nothing in Visual Basic), depending on the element type.

[Visual Basic]
Private Sub Clear() Implements IList.Clear
[C#]
void IList.Clear();
[C++]
private: void IList::Clear();
[JScript]
private function IList.Clear();

Implements

IList.Clear

Exceptions

Exception Type Condition
NotSupportedException The Array is read-only.

-or-

The Array has a fixed size.

Remarks

Reference-type elements are set to a null reference (Nothing in Visual Basic). Boolean-type elements are set to false. Other value-type elements are set to zero.

This method only clears the values of the elements; it does not delete the elements themselves. Array has a fixed size; therefore, elements cannot be added or removed.

Requirements

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

See Also

Array Class | Array Members | System Namespace | ICollection.Count

Show:
© 2014 Microsoft