List<T>.IList.Remove(Object) 方法

定义

IList 中删除特定对象的第一个匹配项。Removes the first occurrence of a specific object from the IList.

 virtual void System.Collections.IList.Remove(System::Object ^ item) = System::Collections::IList::Remove;
void IList.Remove (object item);
Sub Remove (item As Object) Implements IList.Remove

参数

item
Object

要从 IList 中删除的对象。The object to remove from the IList.

实现

异常

item 是一个无法赋值给 IList 的类型。item is of a type that is not assignable to the IList.

注解

此方法使用默认的相等比较器 EqualityComparer<T>.Default 来确定 T(列表中值的类型)的相等性。This method determines equality using the default equality comparer EqualityComparer<T>.Default for T, the type of values in the list.

此方法执行线性搜索;因此,此方法的运算复杂度为 O (n),其中nCountThis method performs a linear search; therefore, this method is an O(n) operation, where n is Count.

适用于