I want to break a string that has some unwanted characters initially and that has unlimited length.
inputtring1 = ";;;USA;23;john;;;USA:24;charles";
String temp = inputString1.split(";;;");
If you just want everything after the first
";;;", just do this:
String stuff = str.replaceFirst(".*?;;;"), "");
A key point here is the reluctant quantifier
*? which consumes as little as possible while still matching.