We are about to switch to a new forum software. Until then we have removed the registration on this forum.
'l' is a variable being used. I want this code to take the number at location 'l' but I get the message "String Index Out Of Bounds Exception: String index out of range: 4" even though the value of l is less than 4.
if (saved.charAt(l) == 1)
Answers
Can you prove that? Add the following debug
1 is and of thing to compare a char to. Do you mean '1'?
@koogs i added what you said to but i still get the same problem. in this case saved = 1001 and 'l' = the length of the string (4).
@koogs i actually figured it out. I forgot that the first character is 0 not 1. Thanks for your help!