I need to remove this in a Java string:
<?xml version="1.0" encoding="UTF-8"?>
I'm receiving badly formatted xml on a queue that has this tag embedded in the middle of the xml, because of some kind of concatenation on the sender's side.
String toReplace = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
String newString = oldString.replaceAll(toReplace, "");
Does anyone know how to handle this?