Determine whether a word appears in a sentence
The String class provides the method .equalsIgnoreCase(). It seems to me, calling .toLowerCase() and then .equals() has to process the string twice, but could be done in a single run.

It is unclear how well the sentence is processed before it enters the method as array. I will be a little optimistic in my assumptions.

You can give it a cleaner structure using streams [if you are using Java 1.8 at least]. It provides a method .noneMatch(predicate) which is short-circuiting just as your loop is now. Using streams makes it easy to add a cascade of string preprocessing steps before the final comparison. Removing punctuation as you have it now, it could be written as follows:

import java.util.Arrays;

public static boolean sentenceContainsWord(final String[] aSentence, final String aWord)
{
    return !Arrays.stream(aSentence)
                  .map((w) -&gt; w.replaceAll("\\.|,|:|;", ""))
                  .noneMatch((w) -&gt; w.equalsIgnoreCase(aWord));
}


My optimistic assumption here is that there is no punctuation in between a word which might result from a too simplistic tokenisation (e.g. .split(" ")). Using .replaceAll() removes a lot of the clutter around finding trailing punctuation and extracting substrings.

Resources:  


Java Doc:
Stream::noneMatch
Java Doc:
String::equalsIgnoreCase
Java Doc:
String::replaceAll