String Containing Exact Substring from Substring List
问题 Scala beginner here, I'm trying to find all the tweets text that contain at least one keyword in the list of keywords given. Where a tweet: case class Tweet(user: String, text: String, retweets: Int) With an example Tweet("user1", "apple apple", 3) Given that wordInTweet should return true if at least one keyword in the list keywords can be found in the tweet's text. I tried implementing it like the following: def wordInTweet(tweet: Tweet, keywords: List[String]): Boolean = { keywords.exists