Array.IList.Clear Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Sets all elements in the Array to zero, to false, or to null, depending on the element type.
Assembly: mscorlib (in mscorlib.dll)
| Exception | Condition |
|---|---|
| NotSupportedException | The Array is read-only. |
Reference-type elements are set to null. 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.
This method is an O(n) operation, where n is Length.