Search:

Type: Posts; User: copeg

Search: Search took 0.12 seconds.

  1. Replies
    3
    Views
    1,359

    Re: Simple code error

    Check and make sure the value is not -1


    if ( wordEndLoc == -1 ){
    // most likely the user entered a single word or just pressed the enter button (the s1 string is empty).
    //Deal with each...
  2. Replies
    3
    Views
    1,359

    Re: Simple code error

    indexOf returns -1 if the search item was not found, so if what a space isn't found you will see this exception when your code continues to try and parse the string.
Results 1 to 2 of 2