How to remove HTML tag from a string using asp.net

This is one of the very usefull code to remove the HTML tag from a string containing HTML tags.


Just pass the string with HTML to this function, it will give you the return string without any HTML tag,


public string RemoveHTML(string strHTML)
{
    return Regex.Replace(strHTML, @”<(.|\n)*?>”, string.Empty);
}


No Comments