I have to search a word in a Java String, but I don't know how to solve the following problem:
Ex: keyword: car
text: I want to take care of the cat.
The keyword appears in another word, but I don't want that to be detected. I want to detect only if the keyword isn't part of another word.
Ex keyword: car
text: I have a new car. (CORRECT)
I can't search for " car " (with spaces before and after), because it can appear as "car." in the text (the end of the sentence), so it would still not detect the correct situations