KotlinSyntax
Scope Function let
Code example
name?.let { println(it) }Runs code on a non-null value.
In Kotlin, scope function let: runs code on a non-null value — name?.let { println(it) }
name?.let { println(it) }name?.let { println(it) }Runs code on a non-null value.
Use name?.let { println(it) }.
Use this pattern: name?.let { println(it) }
Yes. Use Copy code and adapt the example to your program.
No. The language syntax is the same across operating systems.