toProperties

inline fun Map<String, String>.toProperties(): Properties

Converts this Map to a Properties object.

Samples

import samples.*
import kotlin.test.*
import java.util.*
fun main() { 
   //sampleStart 
   val map = mapOf("x" to "value A", "y" to "value B")
val props = map.toProperties()

assertPrints(props.getProperty("x"), "value A")
assertPrints(props.getProperty("y", "fail"), "value B")
assertPrints(props.getProperty("z", "fail"), "fail") 
   //sampleEnd
}