Noob question, is there a simpler way of writing t...
# getting-started
c
Noob question, is there a simpler way of writing the xContainsY line (using Elvis operator etc)? If so I can't see it
Copy code
val x = "abc123"
val y: String?
y = ... // might be null 
val xContainsY = if (y != null) x.contains(y) else false