I would like to split a String into tokens that are stored in an array. However i don not think I am able to use delimiters as the strings information is not separated by a specific set of characters. The information is however always separated by varying amounts of white space.
Like this:
0 147 530.936 1 656.336 -1.12709 656.336 -0.52921 -0.0131993 -0.882138 0 20 0 0 0.878423 0 1.4013E-045 0
My question is, is there a way to use the varying amounts of white space as delimiters, in order to tokenize the string?
How about
String[] tokens = yourString.split("\\s+");
Split uses regex and in regex
"\\s"+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