I have a string that looks some thing like - 56,0,76,0,93,,,,,,,1230. I use a StringTokenizer to split this by ','. However, it seems that this is skipping from 93 straight to 1230. Is there a way to make it return six empty strings before it moves to 1230?
Use String.split()
method instead.
String str = "56,0,76,0,93,,,,,,,1230";
String[] stringArr = str.split(",");
This will return an array of String.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With