Collection.IList.RemoveAt(Int32) Collection.IList.RemoveAt(Int32) Collection.IList.RemoveAt(Int32) Method

定义

移除指定索引处的 Collection 对象项。Removes the Collection object item at the specified index.

 virtual void IListRemoveAt(int index) = System::Collections::IList::RemoveAt;
void IList.RemoveAt (int index);
Sub IListRemoveAt (index As Integer) Implements IList.RemoveAt

参数

index
Int32 Int32 Int32

要移除的项的从零开始的索引。The zero-based index of the item to remove.

异常

index 不是 Collection 对象中的有效索引。index is not a valid index in the Collection object.

Collection 对象是只读的。The Collection object is read-only.

-or- Collection 对象具有固定大小。The Collection object has a fixed size.

注解

在由连续的元素组成的集合(如列表)中,已移除元素下面的元素将上移以占据空出的位置。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 hash table.

适用于

另请参阅