SoFunction
Updated on 2025-03-06

Remove all tags in HTML elements in C#

///   Remove all tags in HTML elements
  public static string StripHTML(string strHtml)
  {
   string strOutput=strHtml;
   Regex regex = new Regex(@"<[^>]+>|</[^>]+>");
   strOutput = (strOutput,"");
   return strOutput;
  }