List<T>.IList.Remove(Object) List<T>.IList.Remove(Object) List<T>.IList.Remove(Object) Method

定義

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 Object 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.

適用於