System.Collections.Generic.List<T>.RemoveRange Method
Removes a range of elements from the list.

Syntax

public void RemoveRange (int index, int count)

Parameters

index
The zero-based starting index of the range of elements to remove.
count
The number of elements to remove.

Exceptions

TypeReason
ArgumentException index + count is greater than stem.Collections.Generic.List<T>.Count.
ArgumentOutOfRangeException

index is less than zero.

-or-

count is less than zero.

Remarks

The items are removed and all the elements following them in the List have their indexes reduced by count.

Requirements

Namespace: System.Collections.Generic
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0