"Current Peak : 830 300"
How can I get hold of the two numbers, but without the spaces. (There are 5 or more spaces in between each substring)
Using apache's StringUtils I got so far:
String workUnit =
StringUtils.substringAfter(thaString,
":");
This gives back:
"830 300"
but still with a lot of spaces and not separated.
Or just using core java:
String input = "Current Peak : 830 300";
String[] parts = input.split("\\s+"); // Split on any number of whitespace
String num1 = parts[3]; // "830"
String num2 = parts[4]; // "300"