Collection.IList.RemoveAt(Int32) 方法

定义

Collection删除指定索引处的对象项。

 virtual void IListRemoveAt(int index) = System::Collections::IList::RemoveAt;
void IList.RemoveAt(int index);
abstract member IListRemoveAt : int -> unit
override this.IListRemoveAt : int -> unit
Sub IListRemoveAt (index As Integer) Implements IList.RemoveAt

参数

index
Int32

要移除的项的从零开始的索引。

例外

index 不是对象中的 Collection 有效索引。

对象 Collection 为只读。

-或-

Collection 对象的大小固定。

注解

在连续元素(如列表)的集合中,已删除元素后面的元素向上移动以占据空置的位置。 如果为集合编制索引,则移动的元素的索引也会更新。 此行为不适用于在概念上将元素分组到存储桶中的集合,例如哈希表。

适用于

另请参阅