Argentini.Halide.H3Text.HtmlRemoveSymbols C# (CSharp) Method

HtmlRemoveSymbols() public static method

Remove all occurrences of HTML-friendly escape sequences (entities).
public static HtmlRemoveSymbols ( string sourceString ) : String
sourceString string String to filter.
return String
        public static String HtmlRemoveSymbols(string sourceString)
        {
            string TextVal = sourceString;

            // First, convert escape sequences to single character codes, to prepare for the conversion back if the content has both already.
            for (int x = 0; x < HtmlSpecialCharacters.Length; x += 2)
                TextVal = TextVal.Replace(HtmlSpecialCharacters[x + 1], HtmlSpecialCharacters[x]);

            // Convert all codes to escape sequences.
            for (int x = 0; x < HtmlSpecialCharacters.Length; x += 2)
                TextVal = TextVal.Replace(HtmlSpecialCharacters[x], HtmlSpecialCharacters[x + 1]);

            // Remove all the escape sequences (entities).
            for (int x = 0; x < HtmlSpecialCharacters.Length; x += 2)
                TextVal = TextVal.Replace(HtmlSpecialCharacters[x + 1], "");

            return TextVal;
        }