Mono Class Library: System.Collections.ArrayList Overview | Members

System.Collections.ArrayList.RemoveRange Method

Removes the specified range of elements from the current instance.

public virtual void RemoveRange (int index, int count)

Parameters

index
A int that specifies the zero-based index of the first element of the range of elements in the current instance to remove. This value is between 0 and the ArrayList.Count of the current instance minus count , inclusive.
count
A int that specifies the number of elements to remove. This value is between 0 and the ArrayList.Count of the current instance minus index , inclusive.

Exceptions

TypeReason
ArgumentOutOfRangeException

index < 0.

-or-

count < 0.

ArgumentExceptionArrayList.Count of the current instance - index < count.
NotSupportedExceptionThe current instance is read-only or has a fixed size.

Remarks

Operation
As described above.

The elements in the range of index to index + count - 1 are removed from the current instance, the rest of the elements are shifted down to fill the position vacated by those elements, the ArrayList.Count of the current instance is decreased by count, and the count positions that were previously the last elements in the current instance are set to null .

Requirements

Namespace: System.Collections
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0