Issue
How to iterate over HashMap in Kotlin
?
typealias HashMap<K, V> = HashMap<K, V> (source)
Solution
It's not that difficult:
for ((key, value) in map) {
println("$key = $value")
}
OR
(Updated in accordance with @RuckusT-Boom's and @KenZira's information.)
map.forEach { (key, value) -> println("$key = $value") }
Answered By - Alexander Romanov
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.