clear
Начиная с Kotlin: 1.0
expect open override fun clear()
Удаляет все элементы из этой карты.
Примеры
import kotlin.test.*
import java.util.*
fun main() {
//sampleStart
val map = mutableMapOf(1 to "one", 2 to "two")
println(map) // {1=one, 2=two}
map.clear()
println(map) // {}
//sampleEnd
}
© 2010–2026 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-linked-hash-map/clear.html