So how do you check if a string has a particular word in it?
So this is my code:
a.setOnClickListener(new View.OnClickListener() {
@Overri
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");
}