CollectionExtensions.Remove<TKey,TValue>(IDictionary<TKey,TValue>, TKey, TValue) Method

Definition

Tenta remover o valor com o key especificado do dictionary.Tries to remove the value with the specified key from the dictionary.

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

Type Parameters

TKey

O tipo das chaves no dictionary.The type of the keys in the dictionary.

TValue

O tipo dos valores em dictionary.The type of the values in the dictionary.

Parameters

dictionary
IDictionary<TKey,TValue>

Um dicionário com chaves do tipo TKey e valores do tipo TValue.A dictionary with keys of type TKey and values of type TValue.

key
TKey

A chave do valor a ser removido.The key of the value to remove.

value
TValue

Quando esse método retorna true, o valor removido; quando esse método retorna false, o valor default de TValue.When this method returns true, the removed value; when this method returns false, the default value for TValue.

Returns

Boolean

true quando um valor é encontrado no dictionary com o key especificado; false quando o dictionary não pode localizar um valor associado ao key especificado.true when a value is found in the dictionary with the specified key; false when the dictionary cannot find a value associated with the specified key.

Exceptions

dictionary é null.dictionary is null.

Applies to