Is there any alternative to string.Normalize() in WinRT? I want to simply remove accents from input strings using this approach, but I cannot find anywhere this method in WinRT.
问问题
1313 次
2 回答
5
我在这里发现了快速而简短的解决方案,它在 WinRT 中运行良好:
public static string RemoveAccents(this string accentedStr)
{
byte[] tempBytes = Encoding.GetEncoding("ISO-8859-8").GetBytes(accentedStr);
return Encoding.UTF8.GetString(tempBytes, 0, tempBytes.Length);
}
于 2012-09-11T11:05:21.203 回答