using System.Text.RegularExpressions //Firstly, you have to add one namespace.
string strWithHtml = "<h1>Sample</h1> p> Hello this is a sample text with html tags. Code will remove all the tags from text.</p>"; // string with html tags
string noHTML = Regex.Replace(strWithHtml, @"<[^>]+>| ", "").Trim();
Response.Write(noHTML);This code show how to Remove Tags from String in C#.
Sometimes we get error in string variable because of html tags in string. There is simple and easier way to remove html tags from string. There is a few lines of code which will help you to remove tags from string.
