I´m doing a project for school and I need my method to return true only to a certain word. This is what I have:
public boolean scanDescription (String keyword) {
if (description.contains(keyword)) {
return true;
} else {
return false;
}
So for example, if the keyword is "disk", I need this method to return true only when a string contains the word "disk", but my problem is that it returns true when a string contains words like "diskette"
PS.: I have also tried to use .indexOf and it did not work