String parts[] = formattedString.split("\\:");
String partA = parts[0];
String partB = parts[1];
I'm trying to split a string before and after the ":" symbol.
For example, "Before:After" works, but in the case where there is nothing after the ":" like "Before: " gives me an exception. I've tried to check for null
in parts[1]
but it still throws exception.