/// <summary> /// 移除文字裡的所有 Html 標籤與空白換行 /// </summary> public static string RemoveHtmlTagWoEmptyLines(string html) { HtmlTextHandler textHandler = new HtmlTextHandler(); string result = textHandler.StripTagsCharArray(html); //拿掉換行符號,開頭,間隔的一堆空白 result = System.Text.RegularExpressions.Regex.Replace(result, @"\s+", " "); return(result); }
/// <summary> /// 移除文字裡的所有 Html 標籤 /// </summary> public static string RemoveHtmlTag(string html) { HtmlTextHandler textHandler = new HtmlTextHandler(); return(textHandler.StripTagsCharArray(html)); }