This documentation is archived and is not being maintained.
CollectionBase.RemoveAt Method
.NET Framework 1.1
Removes the element at the specified index of the CollectionBase instance.
[Visual Basic] Public Overridable Sub RemoveAt( _ ByVal index As Integer _ ) Implements IList.RemoveAt [C#] public virtual void RemoveAt( int index ); [C++] public: virtual void RemoveAt( int index ); [JScript] public function RemoveAt( index : int );
Parameters
- index
- The zero-based index of the element to remove.
Implements
Exceptions
| Exception Type | Condition |
|---|---|
| ArgumentOutOfRangeException | index is less than zero.
-or- index is equal to or greater than Count. |
Remarks
In collections of contiguous elements, such as lists, the elements that follow the removed element move up to occupy the vacated spot. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hashtable.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework
See Also
CollectionBase Class | CollectionBase Members | System.Collections Namespace
Show: