Home  »  Code Snippets  »  C#.Net  »

How to remove html tags from a string using c#.net?

 Posted By : Manoranjan SahooPosted Date : 15/08/2012 09:24:54 AM Category : C#.Net Points : 3

Once i tried to extract all only text value from a html source code. So, i tried some regular expression to detect and remove. Finally got some trick from net. So, here i am giving the complete source code to remove html tags.

string removeHTMLTags(string textcontainshtmlcode)
    return Regex.Replace(textcontainshtmlcode, @"<(.|\n)*?>", string.Empty);

Thank you.

No responses found for this thread. Be the first to respond this thread.
Post Reply
Login to post Response.