Method TryRemove
TryRemove(TKey, out TValue)
Removes the element with the specified key from the System.Collections.Generic.IDictionary<TKey, TValue>.
Declaration
public bool TryRemove(TKey key, out TValue value)
Parameters
Type |
Name |
Description |
TKey |
key |
The key of the element to remove.
|
TValue |
value |
The value that was removed.
|
Returns
Type |
Description |
System.Boolean |
true if the element is successfully removed; otherwise, false. This method also returns false if key was not found in the original System.Collections.Generic.IDictionary<TKey, TValue>.
|
TryRemove(TKey, KeyValuePredicate<TKey, TValue>)
Removes the element with the specified key from the System.Collections.Generic.IDictionary<TKey, TValue>
if the fnCondition predicate is null or returns true.
Declaration
public bool TryRemove(TKey key, KeyValuePredicate<TKey, TValue> fnCondition)
Parameters
Returns
Type |
Description |
System.Boolean |
|
TryRemove<T>(TKey, ref T)
Conditionally removes a key/value pair from the dictionary via an implementation of the
CSharpTest.Net.Collections.IRemoveValue`2 interface.
Declaration
public bool TryRemove<T>(TKey key, ref T removeValue)
where T : IRemoveValue<TKey, TValue>
Parameters
Type |
Name |
Description |
TKey |
key |
|
T |
removeValue |
|
Returns
Type |
Description |
System.Boolean |
|
Type Parameters