I'm stuck with this pretty silly thing;
I got a textfile like this;
Hello::140.0::Bye
I split it into a string array using;
LS = line.split("::");
Then I try to convert the array values containing the number to a double, like this;
Double number = Double.parseDouble(LS[1]);
But I get the following error message;
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
Does anyone have any idea why this doesn't work?
I think it's a problem with reading the file. Did you try printing line and also the contents of LS after splitting?
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