String sentence = "Check this answer and you can find the keyword with this code";
String search = "keyword";
Compare the line of string in given string
if ((sentence.toLowerCase().trim()).equals(search.toLowerCase().trim())) {
System.out.println("not found");
}
else {
System.out.println("I found the keyword");
}