How can I decode HTML characters in C#?

前端 未结 10 2042
夕颜
夕颜 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:40

    Use Server.HtmlDecode to decode the HTML entities. If you want to escape the HTML, i.e. display the < and > character to the user, use Server.HtmlEncode.

提交回复
热议问题