So, I have this logic that breaks a string into 4 characters. Something like that
0108011305080508000000 gives 0108 0113 0508 0508 0000 00
Logic used
String [] splitErrorCode = inputString.split("(?<=\\G....)");
It works fine in Java, but when I run it in Android, I get the wrong output.
0108 011305080508000000
I do not know what is going wrong. After going through the line split function, I realized that Android uses fastSplitwhere, since the Java version has huge split logic.
Shouldn't both functions work the same? Why is this a problem? Any comments / suggestions?
source
share