IImmutableSet<T>.TryGetValue(T, T) IImmutableSet<T>.TryGetValue(T, T) IImmutableSet<T>.TryGetValue(T, T) IImmutableSet<T>.TryGetValue(T, T) Method

定義

判斷資料集是否包含指定值。Determines whether the set contains a specified value.

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

要搜尋的值。The value to search for.

actualValue

如果找到,則為來自集合的相符值;如果沒有相符項目,則為 equalvalueThe matching value from the set, if found, or equalvalue if there are no matches.

傳回

如果找到相符值,則為 true,否則為 falsetrue if a matching value was found; otherwise, false.

備註

以下是 TryGetValue 可能有用的一些案例:Following are some scenarios where TryGetValue may be useful:

  • 您想要重複使用先前儲存的物件參考,而不是建立新的參考。You want to reuse a previously stored object reference instead of creating a new reference.

  • 您想要取得更多關於物件的完整資料You want to retrieve more complete data about an object

適用於