日期:2014-05-20 浏览次数:20493 次
/// <summary> /// 过滤字符串中的html代码 /// </summary> /// <param name="Str">传入字符串</param> /// <returns>过滤后的字符串</returns> public static string LostHTML(string Str) { string Re_Str = ""; if (Str != null) { if (Str != string.Empty) { string Pattern = "<\\/*[^<>]*>"; Re_Str = Regex.Replace(Str, Pattern, ""); } } return (Re_Str.Replace("\\r\\n", "")).Replace("\\r", ""); }