如何迭代 HashMap在 Kotlin
中?
typealias HashMap<K, V> = HashMap<K, V> (source)
最佳答案
没那么难:
for ((key, value) in map) {
println("$key = $value")
}
或
(根据@RuckusT-Boom's和@KenZira's信息更新。)
map.forEach { (key, value) -> println("$key = $value") }
https://stackoverflow.com/questions/47204146/