Dictionary<TKey,TValue>.ValueCollection.ICollection<TValue>.Remove 方法

定義

ICollection<T> 移除特定物件之第一個符合的元素。 這個實作一律會擲回 NotSupportedException

 virtual bool System.Collections.Generic.ICollection<TValue>.Remove(TValue item) = System::Collections::Generic::ICollection<TValue>::Remove;
bool ICollection<TValue>.Remove (TValue item);
abstract member System.Collections.Generic.ICollection<TValue>.Remove : 'Value -> bool
override this.System.Collections.Generic.ICollection<TValue>.Remove : 'Value -> bool
Function Remove (item As TValue) As Boolean Implements ICollection(Of TValue).Remove

參數

item
TValue

要從 ICollection<T> 移除的物件。

傳回

如果 true 已成功從 item 中移除,則為 ICollection<T>,否則為 false。 如果在原始的 false 中找不到 item,則這個方法也會傳回 ICollection<T>

實作

例外狀況

一律擲回。

備註

實作依判斷物件相等的方法會有所不同;例如,List<T> 使用 Default,而 Dictionary<TKey,TValue> 則讓使用者指定要用來比較索引鍵的 IComparer<T> 實作。

適用於

另請參閱