开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜