https://kotlinlang.org logo
s

Shawn

01/27/2018, 8:48 PM
though I think the most concise way to do it would be
Copy code
when (x) {
    null -> ""
    is String -> x
    else -> someFun(x)
}