需要从SQL Server中的字符串替换HTML标记 [英] Need to replace HTML Tags from string in SQL Server
本文介绍了需要从SQL Server中的字符串替换HTML标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的要求是仅从SQL Server中的字符串中删除所有正版HTML标记。例如
我的字符串可以是
My requirement is to remove all the genuine HTML tags only from string in SQL Server. e.g.
my string could be
<P>This is a test Message</P> My salary is <$500 and i have to spent >Rs 899 <br/> Please suggest<font></Font>
我想要的输出应该是
这是一个测试消息我的工资是< $ 500,我必须花费> Rs 899请建议。
My desired output should be
This is a test Message My salary is <$500 and i have to spent >Rs 899 Please suggest.
推荐答案
500我必须花费> Rs 899< br / >请建议< font>< / Font>
500 and i have to spent >Rs 899 <br/> Please suggest<font></Font>
我想要的输出应该是
这是一个测试消息我的工资是<
My desired output should be
This is a test Message My salary is <
500,我必须花费> Rs 899请建议。
500 and i have to spent >Rs 899 Please suggest.
您好Akhil,
你可以参考这个 link [ ^ ],它将帮助您从中删除HTML标记你的字符串,但你需要自定义更多以获得预期的答案
如果你想在C#中做到这一点,下面是你可以使用的代码片段。 />
Hi Akhil,
You could refer this link[^], it will help you to remove the HTML tags from your string but you need customize more to get expected answer
If you want you can do it in C#, below is the code snippet you can make use of.
string htmlString = @"<P>This is a test Message</P> My salary is <
这篇关于需要从SQL Server中的字符串替换HTML标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文