How can I decode HTML characters in C#?

前端 未结 10 2146
夕颜
夕颜 2020-11-22 03:38

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

10条回答
  •  时光取名叫无心
    2020-11-22 03:38

    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.

提交回复
热议问题