我正在尝试使用通配符和 Dictionary 类创建字符串搜索
Dictionary<string, Node> Nodes = new Dictionary<string, Node>();
public bool ResponceSearch(string search) {
if (Nodes.ContainsKey(search)) {
label1.Text = Nodes[search].GetResult();
return true;
}
}
搜索字符串,例如
What is that
并且字典包含键,例如
Who is *
What is *
因此,搜索会根据“what is that”搜索字符串找到“what is *”。