Created
December 24, 2015 02:26
-
-
Save stepango/a1be0eb04cec0068ba5a to your computer and use it in GitHub Desktop.
IsEmpty check for null string made easy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun String?.isEmpty() :Boolean = this == null || "".equals(this) | |
val a :String? = null | |
a.isEmpty() // true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment