Removes a range of elements from the List<T>.
mscorlib (in mscorlib.dll)
public void RemoveRange(
The zero-based starting index of the range of elements to remove.
The number of elements to remove.
The items are removed and all the elements following them in the List<T> have their indexes reduced by count.
This method is an O(n) operation, where n is Count.
The following example demonstrates the RemoveRange method and various other methods of the List<T> class that act on ranges. After the list has been created and modified, the RemoveRange method is used to remove two elements from the list, beginning at index location 2.
private void ovalShape1_Click(System.Object sender, System.EventArgs e)
bool state = true;
if (state == false)
ovalShape1.Scale(new SizeF(2, 3));
state = true;
ovalShape1.Scale(new SizeF((float)0.5, ((float)0.333)));
state = false;
Return to top Universal Windows Platform
Available since 4.5.NET Framework
Available since 2.0Portable Class Library
Supported in: portable .NET platformsSilverlight
Available since 2.0Windows Phone Silverlight
Available since 7.0Windows Phone
Available since 8.1