CollectionExtensions.Remove<TKey,TValue> メソッド

定義

dictionary から、指定した key の値を削除しようとします。

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 を返す場合は、TValuedefault 値。

戻り値

dictionary から指定した key の値が見つかった場合は true。指定した key に関連付けられている値が dictionary で見つからない場合は false

例外

dictionarynullです。

適用対象