希望尽量不是直接要实例就去用,而不关心他本来的意义和实现思路等。加油!
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
///
/// 对字符串进行检查和替换其中的特殊字符
///
///
///
public static string HtmlToTxt(string strHtml)
{
string[] aryReg ={
@"]*?>.*?",
@"<(///s*)?!?((/w+:)?/w+)(/w+(/s*=?/s*(([""’])(//[""’tbnr]|[^/7])*?/7|/w+)|.{0})|/s)*?(///s*)?>",
@"([/r/n])[/s]+",
@"&(quot|#34);",
@"&(amp|#38);",
@"&(lt|#60);",
@"&(gt|#62);",
@"&(nbsp|#160);",
@"&(iexcl|#161);",
@"&(cent|#162);",
@"&(pound|#163);",
@"&(copy|#169);",
@"&#(/d+);",
@"-->",
@"