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

定义

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

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

参数

value
Object

要从 Object 中删除的 IListThe Object to remove from the IList.

实现

例外

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

注解

此方法使用默认比较器 Comparer<T>.Default来确定相等性。This method determines equality using the default comparer Comparer<T>.Default. Comparer<T>.Default 检查类型 T 是否实现 System.IComparable<T> 并使用该实现(如果可用)。Comparer<T>.Default checks whether type T implements System.IComparable<T> and uses that implementation, if available. 否则,Comparer<T>.Default 会检查类型 T 是否实现 System.IComparableIf not, Comparer<T>.Default checks whether type T implements System.IComparable. 如果类型 T 未实现任何一个接口,则此方法使用 Object.EqualsIf type T does not implement either interface, this method uses Object.Equals.

此方法是一个 O (n)操作,其中 nCount的。This method is an O(n) operation, where n is Count.

适用于