There was an error while loading. Please reload this page.
Returns value associated with key, or defaultValue if key does not exists in dictionary
Namespace: CodeJam.CollectionsAssembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0
C#
public static TValue GetValueOrDefault<TKey, TValue>( this Dictionary<TKey, TValue> dictionary, TKey key, TValue defaultValue )
VB
<ExtensionAttribute> Public Shared Function GetValueOrDefault(Of TKey, TValue) ( dictionary As Dictionary(Of TKey, TValue), key As TKey, defaultValue As TValue ) As TValue
F#
[<ExtensionAttribute>] static member GetValueOrDefault : dictionary : Dictionary<'TKey, 'TValue> * key : 'TKey * defaultValue : 'TValue -> 'TValue
Type: TValueValue, associated with the key, or defaultValue if key does not exists in dictionary
In Visual Basic and C#, you can call this method as an instance method on any object of type Dictionary(TKey, TValue). When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
DictionaryExtensions ClassGetValueOrDefault OverloadCodeJam.Collections Namespace