如何使用c#代码删除不需要的html标签? [英] how to remove unwanted html tags using c# code?
问题描述
大家好,
如何使用c#代码从下面的html标签中删除不需要的信息?
< .div align =center>< a style =COLOR:blue;文字装饰:没有onmouseover =弹出窗口('细节:','F2 - 终结/拒绝 - 索赔/线已经被拒绝.CHANGE2 - 2013年10月17日','lightyellow')onmouseout =kill( )href =#; => F2< / a>< / div>< / td>< / tr>< / tbody>< /table.>
我需要'F2 - FINALIZED / DENIAL-索赔/线已被拒绝。 CHANGE2 - 10/17/2013'此信息,任何人都可以帮助我解决上述问题吗?
Hi all,
How to remove unwanted information from the below html tag using c# code?.
"<.div align="center"><a style="COLOR: blue; TEXT-DECORATION: none" onmouseover="popup('Detail:', 'F2 - FINALIZED/DENIAL-THE CLAIM/LINE HAS BEEN DENIED. CHANGE2 - 10/17/2013','lightyellow')" onmouseout="kill()" href="#" ;="">F2</a></div></td></tr></tbody></table.>"
I need 'F2 - FINALIZED/DENIAL-THE CLAIM/LINE HAS BEEN DENIED. CHANGE2 - 10/17/2013' this information, can any one help me on the above one?
推荐答案
谷歌搜索关键词C#strip HTML ,下面的示例结果
删除HTML标签 [ ^ ]
编辑< br $>
-----------
你需要像 http:/这样的工具/htmlagilitypack.codeplex.com/ [ ^ ]
Google for keywords like "C# strip HTML", sample result below
Remove HTML Tags[^]
EDIT
-----------
You need tools like http://htmlagilitypack.codeplex.com/[^]
这里解释了如何删除HTML标签:
删除HTML标签 [ ^ ]
所以请使用其中一个适合您的需求。但是在剥离HTML标签之后,您可能需要对结果字符串进行更多的操作。
祝你好运
Here it is explained how to remove HTML tags:
Remove HTML tags[^]
So use one of them which suits your needs. But you might need to do more manupilation to your resulting string after the stripping HTML tags.
Good luck
这篇关于如何使用c#代码删除不需要的html标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!