Converting & to & etc

user189370 picture user189370 · Oct 13, 2009 · Viewed 97.8k times · Source

I want to convert & to &, " to " etc. Is there a function in c# that could do that without writing all the options manually?

Answer

Matt Hamsmith picture Matt Hamsmith · Oct 13, 2009
System.Web.HttpUtility.HtmlDecode()

Edit: Note from here that "To encode or decode values outside of a web application, use..."

System.Net.WebUtility.HtmlDecode()