HiveBrain v1.2.0
Get Started
← Back to all entries
snippetcsharpCritical

How can I decode HTML characters in C#?

Submitted by: @import:stackoverflow-api··
0
Viewed 0 times
howdecodecharactershtmlcan

Problem

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

Solution

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.

Context

Stack Overflow Q#122641, score: 686

Revisions (0)

No revisions yet.