I am getting response for some images in json format within this tag:
\"xmlImageIds\":\"57948916||57948917||57948918||57948919||57948920||57948921||57
I think I know what your problem is. You need to assign the result of replace()
, not just call it.
String s = "foo||bar||baz";
s = s.replace("||", "|");
System.out.println(s);
I tested it, and just calling s.replace("||", "|");
doesn't seem to modify the string; you have to assign that result back to s
.
Edit: The Java 6 spec says "Returns a new string resulting from replacing all occurrences of oldChar in this string with newChar." (the emphasis is mine).