CollectionExtensions.Remove<TKey,TValue> 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
尝试从中删除具有指定keydictionary值的值。
public:
generic <typename TKey, typename TValue>
[System::Runtime::CompilerServices::Extension]
static bool Remove(System::Collections::Generic::IDictionary<TKey, TValue> ^ dictionary, TKey key, [Runtime::InteropServices::Out] TValue % value);
public static bool Remove<TKey,TValue>(this System.Collections.Generic.IDictionary<TKey,TValue> dictionary, TKey key, out TValue value);
static member Remove : System.Collections.Generic.IDictionary<'Key, 'Value> * 'Key * 'Value -> bool
<Extension()>
Public Function Remove(Of TKey, TValue) (dictionary As IDictionary(Of TKey, TValue), key As TKey, ByRef value As TValue) As Boolean
类型参数
- TKey
中键 dictionary的类型。
- TValue
中 dictionary值的类型。
参数
- dictionary
- IDictionary<TKey,TValue>
包含类型 TKey 键和类型的 TValue值的字典。
- key
- TKey
要删除的值的键。
- value
- TValue
此方法返回true时,已删除的值;此方法返回false时,返回defaultTValue的值。
返回
true当在指定值中找到dictionary时;key当找不到与指定false值关联的值时dictionary。key
例外
dictionary 是 null。