I am trying to parse some output. The output is as follows:
raidz1-0 ONLINE 0 0 0
My code is as follows:
String line = "\traidz1-0 ONLINE 0 0 0";
String[] tokens = line.split("\\s+");
tokens ends up being {"raidz1-0", "ONLINE", "0"}
For some reason the last 2 zeros are discarded. I would like to retain the zeros, please tell me how.
Well, it works fine in my case, and it should work: -
OUTPUT : -
Are you sure, you didn't get the last two zeros?