Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C#, function to replace all html special characters with normal text characters

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?

like image 446
JL. Avatar asked Apr 27 '10 11:04

JL.


2 Answers

You want to use HttpUtility.HtmlDecode.:

Converts a string that has been HTML-encoded for HTTP transmission into a decoded string.

like image 158
Andrew Hare Avatar answered Oct 05 '22 21:10

Andrew Hare


Maybe this helps: WebUtility.HtmlDecode("");

like image 33
Rumata Avatar answered Oct 05 '22 21:10

Rumata