Minor cleanup

This commit is contained in:
Jobobby04
2022-07-18 09:59:09 -04:00
parent 6f4a46b437
commit cec181f444
8 changed files with 21 additions and 98 deletions
+2 -9
View File
@@ -10,13 +10,6 @@ fun String.removeArticles(): String {
return replace(articleRegex, "")
}
fun String.trimOrNull(): String? {
val trimmed = trim()
return trimmed.ifBlank { null }
}
fun String.trimOrNull() = trim().nullIfBlank()
fun String?.nullIfBlank(): String? = if (isNullOrBlank()) {
null
} else {
this
}
fun String.nullIfBlank(): String? = ifBlank { null }