Add isEmpty, isBlank methods and their nullable and negating couterparts.
This commit is contained in:
@@ -28,6 +28,9 @@ public inline fun String.matches(regex : String) : Boolean {
|
||||
return result != null && result.size() > 0
|
||||
}
|
||||
|
||||
|
||||
public fun String.isBlank(): Boolean = length() == 0 || matches("^[\\s\\xA0]+$")
|
||||
|
||||
public fun String.equals(anotherString: String, ignoreCase: Boolean = false): Boolean =
|
||||
if (!ignoreCase)
|
||||
this == anotherString
|
||||
|
||||
Reference in New Issue
Block a user