Kotlin - Operators and Expressions
How can you safely get the length of a nullable string str using the Elvis operator?
How can you safely get the length of a nullable string str using the Elvis operator?
str?.length safely accesses length or returns null if str is null.?: 0 returns 0 if str?.length is null.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions