Skip to content

M_Cyjb_Collections_ReadOnlyPrefixTree_1_TryGetValue

CYJB edited this page Mar 20, 2024 · 2 revisions

ReadOnlyPrefixTree(TValue).TryGetValue 方法

获取与指定键关联的值。

Namespace: Cyjb.Collections
Assembly: Cyjb (in Cyjb.dll) Version: 1.0.23+7750dd8e971297c5fa962a3bee37fb78f72793f6

语法

C#

public override bool TryGetValue(
	string key,
	out TValue value
)

参数

 

key
Type: System.String
要获取其值的键。
value
Type: TValue
如果找到指定键,则返回与该键相关联的值; 否则返回 value 参数的类型的默认值。

返回值

Type: Boolean
如果当前前缀树包含具有指定键的元素,则为 true;否则为 false

实现

IDictionary(TKey, TValue).TryGetValue(TKey, TValue)
IReadOnlyDictionary(TKey, TValue).TryGetValue(TKey, TValue)

Exceptions

 

异常 条件
ArgumentNullException keynull

参见

Reference

ReadOnlyPrefixTree(TValue) 类
Cyjb.Collections 命名空间

Clone this wiki locally