我正在努力实现这样的目标:
string html = @"Hello <b> World ! </b>";
期望的输出是
Hello World !
字符串 html 可以在标签、文本框等任何地方使用。
但它不起作用。它只是按原样显示 Hello <b> World ! </b>
还有其他方法吗?
最佳答案
像这样尝试 HtmlString
:
HtmlString html = new HtmlString("Hello <b> World ! </b>");
关于c# - 如何在 C# 字符串中显示 HTML 内容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22344490/