How to remove all HTML Tags from specified string.
Here is a interesting piece of code to remove all tags.
Specially Html tags are remove and remains plain text.
//A pattern to find the HTML Tags
const string HTML_TAGS = "<.*?>";
public static string RemoveHTML(string inputstr)
{
return Regex.Replace(inputstr, HTML_TAGS, string.Empty);
}
Now implement this RemoveHTML function in Button Click
//In Button's Click
label1.Text = RemoveHTML("
OR
label1.Text = RemoveHTML(textBox1.Text);
Try out with some examples.