Olvasás angol nyelven Szerkesztés

Megosztás a következőn keresztül:


OrderedDictionary<TKey,TValue>.TryGetValue Method

Definition

Overloads

TryGetValue(TKey, TValue)

Gets the value associated with the specified key.

TryGetValue(TKey, TValue, Int32)

TryGetValue(TKey, TValue)

Gets the value associated with the specified key.

C#
public bool TryGetValue(TKey key, out TValue value);

Parameters

key
TKey

The key whose value to get.

value
TValue

When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.

Returns

true if the object that implements IDictionary<TKey,TValue> contains an element with the specified key; otherwise, false.

Implements

Applies to

.NET 10 és .NET 9
Termék Verziók
.NET 9, 10

TryGetValue(TKey, TValue, Int32)

C#
public bool TryGetValue(TKey key, out TValue value, out int index);

Parameters

key
TKey
value
TValue
index
Int32

Returns

Applies to

.NET 10
Termék Verziók
.NET 10