string[] myArray= { "replay", "answer" };
if (myArray.Contains("rểplay")) {
//...
}
此函数将返回 false,因为它尝试检查变音符号“rểplay”而不是“replay”。如何忽略非间距组合字符,例如变音符号并返回 true?
反之亦然,如下所示?
string[] myArray= { "rểplay", "answer" };
if (myArray.Contains("replay")) {
//...
}
以及如何在此功能中应用?
var ix = Array.FindIndex(myKeys, p => p.Equals(wordIn, StringComparison.CurrentCultureIgnoreCase));
wordOut = myKeys[ix];
return true;