Search:

Type: Posts; User: etag

Search: Search took 0.18 seconds.

  1. Replies
    9
    Views
    5,457

    Re: String index is out of range

    Sorry about the short and not to the point replies, I understand that it was pointless and didn't help me or yourself. On the other hand I did end of fixing the overall program by switching from the...
  2. Replies
    9
    Views
    5,457

    Re: String index is out of range

    Ah I knew I was missing something very basic.

    char x = name1.charAt(namelength - 1);
    fixed the exception by adding the -1, but now the if statements that follow don't work either.
  3. Replies
    9
    Views
    5,457

    Re: String index is out of range

    Thanks for the help aussie, I was looking in the wrong place.
    The while loop is a verification loop designed to ensure the name entered only contains letters or whitespace(But now two in a row,...
  4. Replies
    9
    Views
    5,457

    Re: String index is out of range

    Heres what I'm trying to do:

    System.out.print("Enter a last name: ");
    name1 = stdIn.nextLine();

    The program outputs to the user asking for a last name then the user input is stored in the...
  5. Replies
    9
    Views
    5,457

    String index is out of range

    Ok so I'm really novice at java and have been struggling with this particular exception. When I go and enter a name into the string, it pops the exception:


    I could really use some help at this...
Results 1 to 5 of 5