This commit is contained in:
Jobobby04
2020-07-27 13:32:43 -04:00
parent c0e1ca1185
commit f5b6fc5b54
5 changed files with 14 additions and 12 deletions
+6
View File
@@ -12,3 +12,9 @@ fun String.trimOrNull(): String? {
val trimmed = trim()
return if (trimmed.isBlank()) null else trimmed
}
fun String?.nullIfBlank(): String? = if (isNullOrBlank()) {
null
} else {
this
}