Looks like the error starts earlier:
sentence[]: [i, have, a, dog]
firstLetters array: [ , h, , d]
The first letters are white space. You need to trim it at that point.
Type: Posts; User: Starstreak
Looks like the error starts earlier:
sentence[]: [i, have, a, dog]
firstLetters array: [ , h, , d]
The first letters are white space. You need to trim it at that point.