Skip to content

Instantly share code, notes, and snippets.

@redcho
Last active October 1, 2016 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save redcho/fd2b01491ef63d0285c260a7ce427cd2 to your computer and use it in GitHub Desktop.
Save redcho/fd2b01491ef63d0285c260a7ce427cd2 to your computer and use it in GitHub Desktop.
Find first keyword in message
public static String getKeyword(String msg, ArrayList<String> keywordList){
for(String key : keywordList){
if(msg.toLowerCase().contains(key.toLowerCase())){
return key;
}
}
return "";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment