%dw 2.0
import isWhitespace from dw::core::Strings
output application/json
---
{
"a": isWhitespace(null),
"b": isWhitespace(""),
"c": isWhitespace(" "),
"d": isWhitespace("abc"),
"e": isWhitespace("ab2c"),
"f": isWhitespace("ab-c")
}
isWhitespace
isWhitespace(text: String): Boolean
Checks if the text
contains only whitespace.
Introduced in DataWeave version 2.2.0.
Example
This example shows how isWhitespace
behaves with different inputs and sizes.