i have an image path : "UploadFile\\\\/UserProfile\\\\/Female.jpg"
. How to replace "\\\\/"
with "/"
? i have tried :
replaceAll("\\\\/","/")
replaceAll("\\\\\\\\/","/")
Code:
adapter_profilepic = objUser.getProfilePicture().replaceAll("\\/","/");
String src = "UploadFile\\/UserProfile\\/Female.jpg";
src = src.replaceAll("\\\\/","/");
System.out.println(src);
output:
UploadFile/UserProfile/Female.jpg
You said you tried it, but check it again.
According documentation your string is used as regular expression
. Why you don't using replace :
String adapter_profilepic = objUser.getProfilePicture().replace("\\\\/","/");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.