What is different between isEmpty and isBlank in kotlin

item.isEmpty() checks only the length of the the string

item.isBlank() checks the length and that all the chars are whitespaces

That means that

  • " ".isEmpty() should returns false
  • " ".isBlank() should returns true

From the doc of isBlank

Returns true if this string is empty or consists solely of whitespace
characters.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)