語言

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> 用於比較金鑰的實作。

適用於

另請參閱