Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@s1monw1
Last active March 16, 2023 02:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s1monw1/acabf669206638d010bf54c6ad99fa03 to your computer and use it in GitHub Desktop.
Save s1monw1/acabf669206638d010bf54c6ad99fa03 to your computer and use it in GitHub Desktop.
fun <K, V> Map<K, V>.customPrint() {
forEach { (k, v) ->
println("K: $k")
println("V: $v")
println("________________")
}
}
// usage
val mapping = mapOf("a" to 1, "b" to 2, "c" to 3)
mapping.customPrint()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment