Last active
August 12, 2023 13:17
-
-
Save faizul14/67c2e26ea9ccf9ad4b0fc6f82ae23c85 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val name: String? = "Renren" | |
val length = name?.let { | |
println("Name is not null: $it") | |
it.length | |
} ?: 0 | |
// Output: Name is not null: Renren | |
// length = 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment