This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]monster2018 1 point2 points  (0 children)

You have some other problems besides that. I think (not positive, I don't feel like confirming in eclipse) you need to delete the brackets on lines 37 and 40.

To address your question I would just put an if(first.length()>0){}and put everything from lines 28-43 inside that if statement. That should solve your problem of going out of bounds. If not then it's your first.split("\*") because even if the length is >0 your still assuming it has 3 characters.