ConcurrentDictionary<TKey,TValue>.ICollection<KeyValuePair<TKey,TValue>>.Remove 方法

定义

将指定的键/值对从集合中移除。

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

参数

返回

如果该元素已成功移除,则为 true;否则为 false。 如果在原始 ICollection<T> 中找不到 key,此方法也会返回 false。

实现

例外

keyValuePairKey 属性为 null

适用于

另请参阅