if(inputWord.contains(checkWord))
{
int i = inputWord.indexOf(checkWord);
StringBuilder sb = new StringBuilder(inputWord);
sb = sb.delete(i, i+(checkWord.length()));
inputWord = sb.toString();
}
Store your values in String. It will be more easier. Hope this code will help you. If you have to check multiple words, store all words in a array, and put this snippet inside a for loop.