How to use Elvis Operator in Kotlin
Elvis Operator is a most frequently used operator which is denoted by “?:”, its appropriate use is when an object is declared nullable.
How to use Elvis Operator?
object ? : "return something if object is null”
Example:
var abc: String? = null
abc?:"hello world"
Checkout Our Latest Tools
Last edited on August 14, 2022 by Admin