共用方式為


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>

KeyValuePair<TKey,TValue> 結構,代表要從 Dictionary<TKey,TValue> 中移除的索引鍵和值。

傳回

如果成功找到並移除 keyValuePair 所代表的索引鍵和值,則為 true;否則為 false。 如果在 false 中找不到 keyValuePair,則這個方法會傳回 ICollection<T>

實作

適用於