Pretzel.Logic.Templating.Context.SiteContextGenerator.RemoveDiacritics C# (CSharp) Méthode

RemoveDiacritics() public static méthode

public static RemoveDiacritics ( string strThis ) : string
strThis string
Résultat string
        public static string RemoveDiacritics(string strThis)
        {
            if (strThis == null)
                return null;

            strThis = strThis.ToLowerInvariant();

            var sb = new StringBuilder();

            foreach (char c in strThis.Normalize(NormalizationForm.FormD))
            {
                if (CharUnicodeInfo.GetUnicodeCategory(c) != UnicodeCategory.NonSpacingMark)
                    sb.Append(c);
            }
            return sb.ToString();
        }