M_Cyjb_Collections_ReadOnlyPrefixTree_1_TryMatchShortest - CYJB/Cyjb GitHub Wiki

ReadOnlyPrefixTree(TValue).TryMatchShortest 方法

匹配最短的前缀。

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

语法

C#

public bool TryMatchShortest(
	ReadOnlySpan<char> text,
	out KeyValuePair<string, TValue> pair
)

参数

 

text
Type: System.ReadOnlySpan(Char)
要匹配的文本。
pair
Type: System.Collections.Generic.KeyValuePair(String, TValue)
如果找到了需要的匹配,则返回相应的键值对; 否则返回 pair 参数的类型的默认值。

返回值

Type: Boolean
如果当前前缀树找到了最短的匹配,则为 true;否则为 false

参见

Reference

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

⚠️ **GitHub.com Fallback** ⚠️