Vasil Vasil - 18 days ago 10
C# Question

How can I decode HTML characters in C#?

I have email addresses encoded with HTML character entities. Is there anything in .NET that can convert them to plain strings?

Answer

You can use HttpUtility.HtmlDecode

If you are using .NET 4.0+ you can also use WebUtility.HtmlDecode which does not require an extra assembly reference as it is available in the System.Net namespace.

Comments