to
Thanks for your feedback!
Was this page helpful?
Converts this Map to a Properties object.
import kotlin.test.* import java.util.* fun main() { //sampleStart val map = mapOf("x" to "value A", "y" to "value B") val props = map.toProperties() println(props.getProperty("x")) // value A println(props.getProperty("y", "fail")) // value B println(props.getProperty("z", "fail")) // fail //sampleEnd }
xxxxxxxxxx
val map = mapOf("x" to "value A", "y" to "value B")
val props = map.toProperties()
println(props.getProperty("x")) // value A
println(props.getProperty("y", "fail")) // value B
println(props.getProperty("z", "fail")) // fail
Thanks for your feedback!