CSharp examples for System.Web:Web Page
Removes the HTML.
using System.Net; using System.IO;//from w w w. j a v a 2 s .c o m using System.Text.RegularExpressions; using System.Web; using System.Text; using System.Collections.Generic; using System; public class Main{ public static string RemoveHtml(string html) { html = Regex.Replace(html, "<br>", " "); html = Regex.Replace(html, @"<[\s|\S]+?>", string.Empty); html = Regex.Replace(html, " ", " "); html = Regex.Replace(html, " {2,}", " "); html = Regex.Replace(html, @"\s", ""); return html; } }