If you need an array containing two values, you can do this in two lines by extracting a substring and then dividing by ":". In the end, it looks something like this:
s = s.substring(2, s.length()-1);
String[] sarr = s.split("':");
If you really need one line of code, you can combine them into:
String[] sarr = s.substring(2, s.length()-1).split("':");
source
share