I added code tags to your post, making it easier to read. Next time, just highlight your
java and click the "code" button - just like you were making it italic or bold.
Fixing this problem is simple enough. If a String has a length of 10, the characters are at positions 0-9. Your for loop should be "<", not "<=".
correct that, and you will find your next problem that needs fixing...
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors