Dictionary<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

参数

keyValuePair
KeyValuePair<TKey,TValue>

表示要从 Dictionary<TKey,TValue> 中移除的键和值的 KeyValuePair<TKey,TValue> 结构。

返回

如果成功找到并移除 keyValuePair 所表示的键和值,则为 true;否则为 false。 如果在 ICollection<T> 中没有找到 keyValuePair,则此方法返回 false

实现

适用于