Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
exists in scala
object TweetUtil {
def main(args: Array[String]) {
val keywords = List("brown", "fox", "dog", "pangram")
val tweet = "The quick brown fox jumps over a lazy dog. #pangram"
(keywords.foldLeft(false)( _ || tweet.contains(_) ))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment