📅  最后修改于: 2022-03-11 14:54:59.456000             🧑  作者: Mango
let can be used to check null expressions.
fun main(args: Array) {
var name : String? = "Kotlin let null check"
name?.let { println(it) } //prints Kotlin let null check
name = null
name?.let { println(it) } //nothing happens
}
//The code inside is executed only when the property is not null.