如何删除字符串中的html标签 [英] How to remove html tag in string
本文介绍了如何删除字符串中的html标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我必须删除& br& gt;"提交表单时存储在数据库中的我的字符串中的标签.这是示例字符串:"Cobalt II//br".我要这样存储:钴II".编码应使用C#.
感谢您的帮助!
I have to remove "<br>" tag from my string that is stored in the database when the form is submitted. This is an example string: "Cobalt II</br>". I want to store it like this: "Cobalt II". The coding shall use C#.
Thanks for your help!
推荐答案
我找到了此链接 python解析器,用于将html转换为纯文本.
您可以使用动态代码从C#代码中调用python类.
希望对您有帮助,
谢谢
-Amit.
Hi,
I found this link python parser for converting html into plain text.
you can call python class from C# code using dynamic.
hope this will help you,
thanks
-Amit.
var str = "Cobalt II</br>".Replace("</br>", string.Empty);
检查此提示/技巧
删除所有HTML标记并显示仅在内部提供纯文本(以防XML格式不正确) [
Check this Tip/Trick
Remove all the HTML tags and display a plain text only inside (in case XML is not well formed)[^]
这篇关于如何删除字符串中的html标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文