Test for empty
Syntax
$expr.isEmpty()
Description
Checks if the evaluation of expr
is an empty string, an empty set or null
.
Parameter
Name | Type | Description | Mandatory | Default |
---|---|---|---|---|
expr | String/set | The expression for which to check whether it is empty or null . |
yes |
Return value
Type: Boolean
true
, if expr
is empty or null
.
Examples
Empty set
[].isEmpty()
Output: true
Empty string
"".isEmpty()
Output: true
Non-empty set
[0, 1].isEmpty()
Output: false
null
null.isEmpty()
Output: true