C#,功能以取代普通的文本字符的所有HTML特殊字符 [英] C#, function to replace all html special characters with normal text characters
本文介绍了C#,功能以取代普通的文本字符的所有HTML特殊字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有字符从XML模板传入例如:
I have characters incoming from an xml template for example:
& >
有没有一个通用的功能框架存在有其正常的等同替换这些?
Does a generic function exist in the framework to replace these with their normal equivalents?
推荐答案
您想使用 HttpUtility.HtmlDecode
:
这一直是一个字符串转换HTML编码为HTTP传送到一个解码的字符串。
Converts a string that has been HTML-encoded for HTTP transmission into a decoded string.
这篇关于C#,功能以取代普通的文本字符的所有HTML特殊字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文