Sets a range of elements in the
Array to zero, to false, or to null, depending on the element type.
Namespace: SystemAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public static void Clear(
Array array,
int index,
int length
)
Parameters
- array
- Type: SystemArray
The Array whose elements need to be cleared. - index
- Type: SystemInt32
The starting index of the range of elements to clear. - length
- Type: SystemInt32
The number of elements to clear.
Exceptions Exception | Condition |
---|
ArgumentNullException | array is null. |
IndexOutOfRangeException | index is less than the lower bound of array.-or-length is less than zero.-or-The sum of index and length is greater than the size of the Array. |
See Also