c sharp removes all tags in the HTML element

  • 2020-05-05 11:45:55
  • OfStack

///   removes all marks
in the HTML element     public   static   string   StripHTML(string   strHtml)
    {
      string   strOutput=strHtml;
      Regex   regex   =   new   Regex(@" < [^ > ]+ > | < /[^ > ]+ > ");
      strOutput   =   regex.Replace(strOutput,"");
      return   strOutput;
    }


Related articles: