Java 图片地址全部路径与相对路径替换

   public static void main(String[] args) {
       String url="http://www.oicp.net:34919/b2b2c/attachment/ueditor/2017/7/5/19//23077526.jpg";
       if(url.contains("http:/")){
           int head = url.indexOf("http:/");
           int end = url.indexOf("attachement");
           url=url.replaceAll("http://.+?attachment", "fs:/attachment");
           System.out.println(url);
        }
    }

你可能感兴趣的:(java)