语言

IImmutableSet<T>.TryGetValue(T, T) 方法

定义

确定集是否包含指定的值。

public:
 bool TryGetValue(T equalValue, [Runtime::InteropServices::Out] T % actualValue);
public bool TryGetValue(T equalValue, out T actualValue);
abstract member TryGetValue : 'T * 'T -> bool
Public Function TryGetValue (equalValue As T, ByRef actualValue As T) As Boolean

参数

equalValue
T

要搜索的值。

actualValue
T

集中的匹配值(如果找到)或 equalvalue 不存在匹配项。

返回

true 如果找到匹配值,则为否则,为 false.

注解

以下是一些 TryGetValue 可能有用的情况:

  • 你想要重复使用以前存储的对象引用,而不是创建新的引用。

  • 想要检索有关对象的完整数据

适用于