In the world of Java, we know due to null checks how many times we used to check nulls and an empty string as well. Kotlin is aware of this pain point and the stereotype code.kotlin.text package has many such useful functions.
true is returned if this character sequence is empty (contains no characters):
fun CharSequence.isEmpty(): Boolean
true is returned if this character sequence is not empty and contains some characters except whitespace characters:
fun CharSequence.isNotBlank(): Boolean
true is returned if this character sequence is not empty:
fun CharSequence.isNotEmpty(): Boolean
true is returned if this nullable character sequence is either null or empty or consists solely of whitespace characters:
fun ...