Dictionary<TKey,TValue>.ICollection<KeyValuePair<TKey,TValue>>.Remove(KeyValuePair<TKey,TValue>) 方法
定义
从字典中移除键和值。Removes a key and value from the dictionary.
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> 结构。The KeyValuePair<TKey,TValue> structure representing the key and value to remove from the Dictionary<TKey,TValue>.
返回
如果成功找到并移除 keyValuePair 所表示的键和值,则为 true;否则为 false。true if the key and value represented by keyValuePair is successfully found and removed; otherwise, false. 如果在 ICollection<T> 中没有找到 keyValuePair,则此方法返回 false。This method returns false if keyValuePair is not found in the ICollection<T>.