Map<String, Set<String>>> how can access to value


#1

i have string for instance “kotlin” and i want to get value from Map<String, Set>> how can i do it?


#2

I don’t understand what you are trying to do exactly.
You can get a value from a map using the get operator like this

val index = "kotlin"
val value = map[index] // or map["kotlin"]

In your case this should give you a set which you can use as normal.


#3

in this case return value will be set<String>? i need random value from this set<String>


#4

Google is your friend :stuck_out_tongue_winking_eye: