ImmutableSortedDictionary<TKey,TValue>.TryGetKey(TKey, TKey) 方法
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
确定此字典是否包含指定的键。
public:
virtual bool TryGetKey(TKey equalKey, [Runtime::InteropServices::Out] TKey % actualKey);
C#
public bool TryGetKey (TKey equalKey, out TKey actualKey);
abstract member TryGetKey : 'Key * 'Key -> bool
override this.TryGetKey : 'Key * 'Key -> bool
Public Function TryGetKey (equalKey As TKey, ByRef actualKey As TKey) As Boolean
- equalKey
- TKey
要搜索的键。
- actualKey
- TKey
如果找到匹配项,则位于字典中;如果未找到匹配项, equalkey
则为 。
如果找到了 equalKey
的匹配项,则为 true
;否则为 false
。
下面是一些可能有用的方案 TryGetKey :
你想要重用以前存储的对象引用,而不是创建新引用。
你想要查找对象的规范值
想要检索有关对象的更完整数据
产品 | 版本 |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
UWP | 10.0 |