Dictionary<TKey,TValue>.ICollection<KeyValuePair<TKey,TValue>>.Remove(KeyValuePair<TKey,TValue>) Dictionary<TKey,TValue>.ICollection<KeyValuePair<TKey,TValue>>.Remove(KeyValuePair<TKey,TValue>) Dictionary<TKey,TValue>.ICollection<KeyValuePair<TKey,TValue>>.Remove(KeyValuePair<TKey,TValue>) Method

定義

從字典移除索引鍵和值。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);
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> KeyValuePair<TKey,TValue>

KeyValuePair<TKey,TValue> 結構,代表要從 Dictionary<TKey,TValue> 中移除的索引鍵和值。The KeyValuePair<TKey,TValue> structure representing the key and value to remove from the Dictionary<TKey,TValue>.

傳回

如果成功找到並移除 keyValuePair 所代表的索引鍵和值,則為 true;否則為 falsetrue if the key and value represented by keyValuePair is successfully found and removed; otherwise, false. 如果在 false 中找不到 keyValuePair,則這個方法會傳回 ICollection<T>This method returns false if keyValuePair is not found in the ICollection<T>.

實作

適用於