Search:

Type: Posts; User: KristopherP

Search: Search took 0.10 seconds.

  1. [SOLVED] Re: java.lang.StringIndexOutOfBoundsException: String index out of range: 0

    I did the nested if and it worked. Thanks for your help
  2. [SOLVED] Re: java.lang.StringIndexOutOfBoundsException: String index out of range: 0

    I tried your suggestion with

    if( size > 0)
    {
    answer = input.charAt(0);
    }


    When I get to the next part it tells me answer is not initialized
  3. [SOLVED] Re: java.lang.StringIndexOutOfBoundsException: String index out of range: 0

    So if I added something like this to check the length of the string, where would I need to add it to prevent the crash? Would I had a comparison to my if statement?

    int size;
    size =...
  4. [SOLVED] java.lang.StringIndexOutOfBoundsException: String index out of range: 0

    I am having trouble with my program. I finished it but, I can not get the begging to cooperate. I need to take a users input if they would like to play a game. I have to use the charAt method to...
Results 1 to 4 of 4