我有一个图像路径:"UploadFile\\/UserProfile\\/Female.jpg"
。如何"\\/"
替换"/"
?我努力了 :
replaceAll("\\/","/")
replaceAll("\\\\/","/")
代码:
adapter_profilepic = objUser.getProfilePicture().replaceAll("\\/","/");
我有一个图像路径:"UploadFile\\/UserProfile\\/Female.jpg"
。如何"\\/"
替换"/"
?我努力了 :
replaceAll("\\/","/")
replaceAll("\\\\/","/")
代码:
adapter_profilepic = objUser.getProfilePicture().replaceAll("\\/","/");
这有效:
String src = "UploadFile\\/UserProfile\\/Female.jpg";
src = src.replaceAll("\\\\/","/");
System.out.println(src);
输出:
UploadFile/UserProfile/Female.jpg
你说你试过了,但再检查一次。