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;
}