Case-INsensitive Dictionary with string key-type in C#

后端 未结 5 1961
余生分开走
余生分开走 2020-11-30 23:53

If I have a Dictionary is it possible to make methods like ContainsKey case-insensitive?

This seemed related, but I didn\

5条回答
  •  余生分开走
    2020-12-01 00:16

    There are few chances where your deal with dictionary which is pulled from 3rd party or external dll. Using linq

    YourDictionary.Any(i => i.KeyName.ToLower().Contains("yourstring")))

提交回复
热议问题