CharSequence.kt 278 Bytes
Newer Older
1 2 3
package chat.rocket.android.util.extensions


Lucio Maciel's avatar
Lucio Maciel committed
4
inline fun CharSequence?.ifNotNullNorEmpty(block: (CharSequence) -> Unit) {
5 6 7
    if (this != null && this.isNotEmpty()) {
        block(this)
    }
Lucio Maciel's avatar
Lucio Maciel committed
8 9 10
}

fun CharSequence?.isNotNullNorEmpty(): Boolean = this != null && this.isNotEmpty()