Include System.Text.RegularExpressions
public string Strip(string text)
{
return Regex.Replace(text, @”<(.|\n)*?>”, string.Empty);
}
String myArticle=Strip("<a href="#"><b>Article</b></a>");
This code will help us to remove the HTML tags contained in a string variable using Regular Expression.
Remove HTML Tags from String Variable in C#
Hot on Web: