TryGetValue

TryGetValue<T>(int, out T)

Gets the element’s value at the specified position.

public bool TryGetValue<T>(int index, out T? value)
ParameterDescription
TType of the return value.
indexThe index of the element value to retrieve, which is either from the beginning or the end of the sequence.
valueWhen this method returns, contains the value at the specified position (index); otherwise, contains the default value for the type of the value parameter.

Return Value

true if the element value could be extracted; otherwise, false.

See Also


TryGetValue<T>(Index, out T)

Gets the element’s value at the specified position.

public bool TryGetValue<T>(Index index, out T? value)
ParameterDescription
TType of the return value.
indexThe index of the element value to retrieve, which is either from the beginning or the end of the sequence.
valueWhen this method returns, contains the value at the specified position (index); otherwise, contains the default value for the type of the value parameter.

Return Value

true if the element value could be extracted; otherwise, false.

See Also