how about `blockList.all { name.contains(it, true)...
# getting-started
z
how about
blockList.all { name.contains(it, true) }
?
🧵 1
e
&& -> all, || -> any
👍 1
z
oh sorry, misread the line above
but yeah, the solution's the same just swap all for any
c
THANK YOU!
m
Copy code
"one|two|three"
    .toRegex(RegexOption.IGNORE_CASE)
    .containsMatchIn(name)
💯 1
m
Copy code
fun String.containsAnyIgnoringCase(vararg s: String) = s.any { contains(it, true) }

"foo bar batz".containsAnyIgnoringCase("bar", "baz")
Better keep the contains api consistent:
Copy code
fun String.containsAny(vararg s: String, ignoreCase: Boolean = false) = s.any { contains(it, ignoreCase) }

"foo bar batz".containsAny("bar", ignoreCase = true)