I want to extract and split string which contains alpha and numeric characters separately. Eg String: 2Xccc7.08DD Output should be : [2,Xccc,7.08,DD]
I tried it using this code but it does not work.
myString.split("(\\d+|[a-zA-Z]+)");
For String#split(regex)
you can use this regex:
(?<=[a-z])(?=[A-Z0-9])|(?<=[0-9])(?=[A-Za-z])