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

定义

ICollection<T>中删除特定对象的第一个匹配项。 此实现始终引发 NotSupportedException

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

参数

item
TKey

要从 . ICollection<T>中删除的对象。

返回

如果 已成功从 /> 中删除,则为 ;否则为 。 此方法还返回 false 在原始 ICollection<T>项中找不到时。

实现

例外

总是抛出。

注解

实现在确定对象相等性的方式上可能有所不同;例如, List<T> 使用 Default,而 Dictionary<TKey,TValue> 允许用户指定 IComparer<T> 用于比较键的实现。

适用于

另请参阅