What does this print?
fun main() {
val s: String? = "code"
val len = s?.length
println(len)
}
Try it in the online Kotlin Playground →
[spoiler title="Solution"]
Answer:
4
Explanation:
Safe call returns the property value if not null, else null.
[/spoiler]