List<T>::RemoveAt Method (Int32)
Removes the element at the specified index of the List<T>.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- index
-
Type:
System::Int32
The zero-based index of the element to remove.
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException |
When you call RemoveAt to remove an item, the remaining items in the list are renumbered to replace the removed item. For example, if you remove the item at index 3, the item at index 4 is moved to the 3 position. In addition, the number of items in the list (as represented by the Count property) is reduced by 1.
This method is an O(n) operation, where n is (Count - index).
Available since 8
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1