You say letter, you say word, what do you search exactly?
I you search word, you have to search a word inside word boundaries: regex java.util.regex.Pattern \b as shown by anubhavaanubhava.
You may replace } else if (indexfound < -1) { by } else { because java.lang.indexOf() return -1 when not found >-1 otherwise, < -1 does never occurs.