ifEmpty

inline fun <C : CharSequence, R, R> C.ifEmpty(defaultValue: () -> R): R(source)

Returns this char sequence if it's not empty or the result of calling defaultValue function if the char sequence is empty.

Since Kotlin

1.3

Samples