Mar*_*han 3 windows-8 windows-runtime
在WinRT中有没有替代string.Normalize()的方法?我想简单地使用这种方法从输入字符串中删除重音,但我在WinRT中找不到任何方法.
我在这里发现了快速而简短的解决方案,在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);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1294 次 |
| 最近记录: |