String object charAt(index) question.

PaulS:

Why in the world would it not always index the first letter in the string to zero????

-1 means that the character was not in the string. It does not mean that it was at position -1.

Thanks for pointing that out. Turns out I was assigning a NULL character to the first position in the string which I am guessing made it impossible to find any characters that came after it because a NULL character signifies the end of the string. I moved some things around and now the sketch is working as intended. Thanks!