語言

ImmutableDictionary<TKey,TValue>.Builder.GetValueOrDefault 方法

定義

多載

名稱 Description
GetValueOrDefault(TKey, TValue)

如果字典中有相符的索引鍵,則取得指定索引鍵的值。

GetValueOrDefault(TKey)

如果字典中有相符的索引鍵,則取得指定索引鍵的值。

GetValueOrDefault(TKey, TValue)

來源:
ImmutableDictionary_2.Builder.cs
來源:
ImmutableDictionary_2.Builder.cs
來源:
ImmutableDictionary_2.Builder.cs
來源:
ImmutableDictionary_2.Builder.cs
來源:
ImmutableDictionary_2.Builder.cs
來源:
ImmutableDictionary_2.Builder.cs
來源:
ImmutableDictionary_2.Builder.cs

如果字典中有相符的索引鍵,則取得指定索引鍵的值。

public:
 TValue GetValueOrDefault(TKey key, TValue defaultValue);
public TValue GetValueOrDefault(TKey key, TValue defaultValue);
member this.GetValueOrDefault : 'Key * 'Value -> 'Value
Public Function GetValueOrDefault (key As TKey, defaultValue As TValue) As TValue

參數

key
TKey

要搜尋的鍵。

defaultValue
TValue

如果字典中找不到相符的鍵,則預設回傳的值。

傳回

TValue

如果找不到匹配的金鑰,則是該金鑰 defaultValue 的值。

適用於

GetValueOrDefault(TKey)

來源:
ImmutableDictionary_2.Builder.cs
來源:
ImmutableDictionary_2.Builder.cs
來源:
ImmutableDictionary_2.Builder.cs
來源:
ImmutableDictionary_2.Builder.cs
來源:
ImmutableDictionary_2.Builder.cs
來源:
ImmutableDictionary_2.Builder.cs
來源:
ImmutableDictionary_2.Builder.cs

如果字典中有相符的索引鍵,則取得指定索引鍵的值。

public:
 TValue GetValueOrDefault(TKey key);
public TValue GetValueOrDefault(TKey key);
public TValue? GetValueOrDefault(TKey key);
member this.GetValueOrDefault : 'Key -> 'Value
Public Function GetValueOrDefault (key As TKey) As TValue

參數

key
TKey

要搜尋的鍵。

傳回

TValue

如果找不到匹配的金鑰,則是該金鑰 default(TValue) 的值。

適用於