Scala SeqLikeimplement the method contains. How can I purely implement a function containsAny?
Let's say I want to find out if a string contains stringany of the blacklists in blacklist:
val blacklist = List("(", ")", "[", "]", "{", "}", "<", ">")
string containsAny blacklist
What is the best way to implement the second line cleanly?
My version looks like this:
(blacklist.view map string.contains) contains true
source
share