string.replace(str,str);
后面的替换前面的

解决方案 »

  1.   

    不行呀~!
    236. str=str.replace("'","");
    <----------------->
    *** Error: No match was found for method "replace(java.lang.String, java.lang.String)".出现以上错误
      

  2.   

    replaceAll(String s1,String s2 )
      

  3.   

    267. strSql.replaceAll("'","''");
    <------------------------->
    *** Error: No method named "replaceAll" was found in type "java/lang/String".呵呵~!
    急呀
      

  4.   

    strSql.replaceAll("'","''");这个要用转义符的吧,strSql.replaceAll("\'","\''");
      

  5.   

    strSql.replaceAll("\'","\''");
    这个差不多吧
      

  6.   

    strSql.replaceAll("'"," ");
    这样行吗???
      

  7.   

    replaceAll好象在JDK1.4中才能用啊。帮你UP吧
      

  8.   

    我是用两个单引号替换一个单引号!~
    看有没其他办法,我用客房端处理。在JAVASCRIPT中,但好像没换过来~!
    如下:
    out.println("<script>'"+searchContent+"'='"+searchContent+"'.replace(\"'\",\"''\");</script>");
      

  9.   

    到JB里面试试吧~!
    好像也只能用replaceAll();