Use the java.lang.String split function with a limit.
String foo = "some string with spaces"; String parts[] = foo.split(" ", 2); System.out.println(String.format("cr: %s, cdr: %s", parts[0], parts[1]));
You'll get:
cr: some, cdr: string with spaces
source share