0

I see a similar case which answer my question in JQuery way: Remove tag but leave contents - jQuery/Javascript

But I need to know how C# works for this? Is there any API in C# that I can use to strip out the tag and leave the plane text?

From:

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

To:

some content and more and more content

Thanks.

Community
  • 1
  • 1
JerryCai
  • 1,663
  • 4
  • 21
  • 36

1 Answers1

0

Use HtmlAgilityPack ( http://htmlagilitypack.codeplex.com/ ), load your HTML document into a HtmlDocument instance and query document.DocumentNode.InnerText.

Dai
  • 141,631
  • 28
  • 261
  • 374