2013-03-09 62 views
0

我看到的回答我在JQuery的方式问题,类似的案例: Remove tag but leave contents - jQuery/Javascript如何删除html标签,并在C#中留下文本?

但我需要知道C#是如何工作的呢? C#中是否有任何API可用于去除标签并留下平面文本?

来源:

<a href="#">some content</a> and more <a href="#"> and more content</a> 

要:

some content and more and more content 

感谢。

+2

HTMLAgilityPack .. http://stackoverflow.com/questions/787932/using-c-sharp-regular-expressions-to-remove-html-tags – 2013-03-09 06:14:49

+0

你也可以看看正则表达式 – TGH 2013-03-09 06:20:22

+0

@TGH是的,我知道的正则表达式可以做到这一点,但我想知道是否有这方面的最佳做法? – JerryCai 2013-03-09 06:49:56

回答