Check if the inputted string contains something on my list
Let's say i input "i love you". If you have type开发者_JS百科d a statement that contains a "love" word then it will do something.
Try:
List<String> keywords = // your words
for (String key : keywords) {
if (yourPhrase.contains(key)) {
// do something
}
}
It should do the job.
精彩评论