Click or drag to resize
ArrayClear Method
Sets a range of elements in the Array to zero, to false, or to null, depending on the element type.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
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
ExceptionCondition
ArgumentNullExceptionarray is null.
IndexOutOfRangeExceptionindex 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