要求如下:
<H2>xclkvj<FONT color=#33ff66>poqwu</FONT>r<EM>pe</EM>irp<FONT color=#6666cc>oy</FONT>tg;lm<U>caadv</U></H2>我想要的结果是xclkvjpoqwurpeirpoytg;lmcaadv(即无任何格式,样式的内容)

解决方案 »

  1.   

    Regex.Replace(s,@"<[^>]+>","")
      

  2.   

    最简单的
    string content = "<H2>xclkvj <FONT color=#33ff66>poqwu </FONT>r <EM>pe </EM>irp <FONT color=#6666cc>oy </FONT>tg;lm <U>caadv </U> </H2>";
    string value = System.Text.RegularExpressions.Regex.Replace ( content, "<[^>]+>", "" ).Trim();
    3.0的话 自己实现个扩展方法    public static class Extension {
            public static string TrimHtml ( this string source ) {
                return System.Text.RegularExpressions.Regex.Replace ( source , "<[^>]+>", "" );
            }
        }//使用的时候 
       string value = content.TrimHtml ().Trim();