ConcurrentDictionary<TKey,TValue>.IDictionary<TKey,TValue>.Remove(TKey) 方法
定义
从 IDictionary<TKey,TValue> 中移除包含指定键的元素。Removes the element with the specified key from the IDictionary<TKey,TValue>.
virtual bool System.Collections.Generic.IDictionary<TKey,TValue>.Remove(TKey key) = System::Collections::Generic::IDictionary<TKey, TValue>::Remove;
bool IDictionary<TKey,TValue>.Remove (TKey key);
abstract member System.Collections.Generic.IDictionary<TKey,TValue>.Remove : 'Key -> bool
override this.System.Collections.Generic.IDictionary<TKey,TValue>.Remove : 'Key -> bool
Function Remove (key As TKey) As Boolean Implements IDictionary(Of TKey, TValue).Remove
参数
- key
- TKey
要移除的元素的键。The key of the element to remove.
返回
如果该元素已成功移除,则为 true;否则为 false。true if the element is successfully removed; otherwise, false. 如果在原始 false 中没有找到 key,此方法也会返回 IDictionary<TKey,TValue>。This method also returns false if key was not found in the original IDictionary<TKey,TValue>.
实现
例外
key 为 null。key is null.