I have characters incoming from an xml template for example:
& >
Does a generic function exist in the framework to replace these with their normal equivalents?
I have characters incoming from an xml template for example:
& >
Does a generic function exist in the framework to replace these with their normal equivalents?
You want to use HttpUtility.HtmlDecode
.:
Converts a string that has been HTML-encoded for HTTP transmission into a decoded string.
Sometimes the text has parts that has been doubly encoded.
For example: "Lorem Ipsum
    - Blah"
This may help with that:
public static string RecursiveHtmlDecode(string str) {
if (string.IsNullOrWhiteSpace(str)) return str;
var tmp = HttpUtility.HtmlDecode(str);
while (tmp != str)
{
str = tmp;
tmp = HttpUtility.HtmlDecode(str);
}
return str; //completely decoded string
}