I want to convert & to &, " to \" etc. Is there a function in c# that could do that without writing all the options manually?<
&
"
Use the static method
HttpUtility.HtmlEncode
to change & to & and " to ". Use
HttpUtility.HtmlDecode
to do the reverse.