rootandy
02/16/2018, 3:02 PMval foo: String? = null
val bar = foo?.let { thingThatCouldReturnNull() } ?: "Hello"
val baz = if (foo != null) thingThatCouldReturnNull() else "Hello"
println(bar) // prints "Hello" if thingThatCouldReturnNull() returns null
println(baz) // prints "null" if thingThatCouldReturnNull() returns null