string str= @"<table id=""biz0_id0"" border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"" style=""border-bottom: gray 1px dashed""> ";
            str = System.Text.RegularExpressions.Regex.Replace(str, @"style=""[^""]*?""", "");
            Response.Write(Server.HtmlEncode(str));

解决方案 »

  1.   

    @"<table id=""biz"+ l +"_id"+ll+""" border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"" style=""border-bottom: gray 1px dashed"">"这样报错了
    我这个加l的应该怎样写啊,多谢
      

  2.   

    每一个string前面加@如:
    @" <table id=""biz"+ l +@"_id"+ll+@""......
      

  3.   

    不好意思,我搞错了,我现在想的是替换为
    <table id="biz0_id0" border="0" cellpadding="0" cellspacing="0" width="100%" style="display:none">
    请问这个应该怎样写 
      

  4.   

    System.Text.RegularExpressions.Regex.Replace(str, @"style=""[^""]*?""", ""); 
    ---------------
    有人出手了,还没解决吗??看着这么多引号比较迷
    Replace(str, "style=\"[^\"]*?\"",""); 
    嗯这样就顺眼多了
      

  5.   


    那就改成这样
    Replace(str, "(?<=style=\")[^\"]*?(?=\")","display:none"); 
      

  6.   

    写个JS 一处 biz0_id0 的style属性就OK了!
    万一你要替换的多个空格 你就白替换了
      

  7.   

    写个JS 一处 biz0_id0 的style属性就OK了!
    万一你要替换的多个空格 你就白替换了
      

  8.   

    str = Regex.Replace(str, "style=\".+?\"", "");即可