Check if a string is null, empty, or only whitespace.
The isNullOrBlank function returns true if the receiver is null, empty, or contains only whitespace characters. It is stricter than isNullOrEmpty.
This function smart-casts the receiver to non-null after a false result. It is commonly used for validating user input where whitespace-only strings should be treated as empty.
isNullOrBlank is available on nullable CharSequence? types.
println(null.isNullOrBlank()) // true
println("".isNullOrBlank()) // true
println(" ".isNullOrBlank()) // true
println("hello".isNullOrBlank()) // false