Problems with converting a String to a float

If you have an out of bounds exception, it probably means that you try to access an element of the array that does not exist.

So my guess is that this line: String[] list = split(s, ","); does not behave the way you expect.

Did you print s in the console to see how it looks like?

Also can you please format your code with the </> icon? Thanks.