Linq包含不考虑重音

Ing*_*rid 2 c# linq

我需要得到所有结果,其中文本包含一个忽略所有重音的特定单词.

现在我有以下内容:

filtered = result.Where(p => p.@string.ToString().ToUpper().Contains(word));
Run Code Online (Sandbox Code Playgroud)

或简化版:

filtered = result.ToUpper().Contains(word));
Run Code Online (Sandbox Code Playgroud)

如何使"Contains"语句忽略重音?

提前致谢

D S*_*ley 11

在此处借用类似的解决方案:

string[] result = {"hello there", "héllo there","goodbye"};

string word = "héllo";

var compareInfo = CultureInfo.InvariantCulture.CompareInfo;

var filtered = result.Where(
      p => compareInfo.IndexOf(p, word, CompareOptions.IgnoreNonSpace) > -1);
Run Code Online (Sandbox Code Playgroud)