Is there any idiomatic way to having a List<String> and Map<String,Boolean> check if map...
p
Is there any idiomatic way to having a List<String> and Map<String,Boolean> check if map contains any key of the List<String>?
r
like this?
Copy code
list.any { it in map }
p
Yes for instance if I have a list of "a,b,c,d,e" I want to check if is there any map key with "a,b,c,d or e"
g
Copy code
map.keys.any { it in list }
?
1
👍 1