📜  c# convertir caracter con tilde - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:53.390000             🧑  作者: Mango

代码示例1
public static class StringExtensions
{
    public static string SinTildes(this string texto) =>
        new String(
            texto.Normalize(NormalizationForm.FormD)
            .Where(c => CharUnicodeInfo.GetUnicodeCategory(c) != UnicodeCategory.NonSpacingMark)
            .ToArray()
        )
        .Normalize(NormalizationForm.FormC);
}