I have a structure as this:
String xml = "<tag><another_tag>%s</another_tag></tag>"
and I pass a parameter to method and try to replace %s:
String str = String.format(xml, parameter);
But I have got previous xml file wrapped as a tag on the place of ‘%s’. If I set a simple String:
String str = String.format(xml, "parameter");
all works well.
Why does it happen?
As Pshemo says, this works fine: