I have a string that I want to split;
String x = "abc4.5efg2hij89k.9";
I want the result to be
abc, 4.5, efg, 2, hij, 89, k, .9
I can easily separate numbers and numbers. considered a character.
x.split("(?<=\\D)(?=\\d)|(?<=\\d)(?=\\D)")
[abc, 4, ., 5, efg, 2, hij, 89, k., 9]
What is the best way to support doubles?
source
share