我有一个字典,我的键是带有通配符的字符串。我想知道一个字符串是否与字典中的任何键匹配。
例子:
String str = "Really Large String";
Dictionary dic = new Dictionary<String, MyClass>();
dic.Add("First+Match*", new MyClass());
dic.Add("*Large*", new MyClass());
编辑: 我想做类似于以下内容:
foreach(var s in dic.Keys){
if(str.Match(s))
//Do Something
}