SortedList<TKey,TValue>.RemoveAt(Int32) 方法

定义

移除 SortedList<TKey,TValue> 的指定索引处的元素。Removes the element at the specified index of the SortedList<TKey,TValue>.

public:
 void RemoveAt(int index);
public void RemoveAt (int index);
member this.RemoveAt : int -> unit
Public Sub RemoveAt (index As Integer)

参数

index
Int32

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

例外

index 小于零。index is less than zero.

- 或 --or- index 等于或大于 Countindex is equal to or greater than Count.

注解

此方法执行二进制搜索;但是,元素将上移以填充打开的位置,因此,此方法是 O (n) 操作,其中 nCountThis method performs a binary search; however, the elements are moved up to fill in the open spot, so this method is an O(n) operation, where n is Count.

适用于

另请参阅