OrderedDictionary<TKey,TValue>.Remove Method

Definition

Overloads

Remove(TKey)

Removes the element with the specified key from the IDictionary<TKey,TValue>.

Remove(TKey, TValue)

Removes the value with the specified key from the OrderedDictionary<TKey,TValue> and copies the element to the value parameter.

Remove(TKey)

Removes the element with the specified key from the IDictionary<TKey,TValue>.

C#
public bool Remove(TKey key);

Parameters

key
TKey

The key of the element to remove.

Returns

true if the element is successfully removed; otherwise, false. This method also returns false if key was not found in the original IDictionary<TKey,TValue>.

Implements

Applies to

.NET 10 och .NET 9
Produkt Versioner
.NET 9, 10

Remove(TKey, TValue)

Removes the value with the specified key from the OrderedDictionary<TKey,TValue> and copies the element to the value parameter.

C#
public bool Remove(TKey key, out TValue value);

Parameters

key
TKey

The key of the element to remove.

value
TValue

The removed element.

Returns

true if the element is successfully found and removed; otherwise, false.

Applies to

.NET 10 och .NET 9
Produkt Versioner
.NET 9, 10