How to remove HTML tags and delete HTML
This article will explain in detail how to remove HTML tags and delete HTML, the editor thinks it is very practical, so share it for you to do a reference, I hope you can get something after reading this article.
The code is as follows:
/ / remove HTML tags / public static string DeleteHTML (string Htmlstring) {/ / Delete HTML Htmlstring = Regex.Replace (Htmlstring, @ "] *) >", ", RegexOptions.IgnoreCase); Htmlstring = Regex.Replace (Htmlstring, @" ([\ r\ n]) [\ s] + ",", RegexOptions.IgnoreCase); Htmlstring = Regex.Replace (Htmlstring, @ "-->", ", RegexOptions.IgnoreCase) Htmlstring = Regex.Replace (Htmlstring, @ "