IDictionary<TKey,TValue>.TryUpdateValue Method

Definition

Updates the value associated with the specified key.

Delphi
function TryUpdateValue(const key: TKey; const newValue: TValue; var oldValue: TValue): Boolean

Parameters

key
TKey

The key of the element to update.

newValue
TValue

The new value to be associated with the specified key, if the key is found.

oldValue
TValue

The original value associated with the specified key, if the key is found; otherwise, Default(TValue) .

Returns

Boolean

True if the key is found and the value updated; otherwise, False .