e:\hedex/resources/index/_0.cfs
这个是一串字符串,我想把中间的 '/resources/' 换成 '/'换后的结果就是
e:/hedex/index/_0.cfs
 如果是用循环除掉那就不用写了,谢谢,我想问下其他的方法

解决方案 »

  1.   

    用String 的replace函数不就完了吗
      

  2.   

    "e:\\hedex/resources/index/_0.cfs".replace("'/resources","").replace("\\","/");
      

  3.   

      .replace("'/resources","").replace("\\","/")  此方法只针对CHAR类型,我的是string类型的,这样不行,
      

  4.   

     OK了,已经解决,我晕,是我JDK太老了,,不支持最新的方法。。
      

  5.   

    String str1 = "this is my first program ";
    str1 = str1.replaceAll("first", "second");
    System.out.println("st1=="+str1);