IReadOnlyDictionary<TKey,TValue>.GetValueOrDefault Method

Overloads

GetValueOrDefault(TKey)

Gets the value for a given key if a matching key exists in the dictionary; returns the default value otherwise.

GetValueOrDefault(TKey, TValue)

Gets the value for a given key if a matching key exists in the dictionary; returns the given default value otherwise.

GetValueOrDefault(TKey)

Gets the value for a given key if a matching key exists in the dictionary; returns the default value otherwise.

Delphi
function GetValueOrDefault(const key: TKey): TValue

Parameters

key
TKey

Returns

TValue

GetValueOrDefault(TKey, TValue)

Gets the value for a given key if a matching key exists in the dictionary; returns the given default value otherwise.

Delphi
function GetValueOrDefault(const key: TKey; const defaultValue: TValue): TValue

Parameters

key
TKey
defaultValue
TValue

Returns

TValue