%dw 2.0
import * from dw::core::Strings
output application/json
---
"12 34 56" everyCharacter $ == " " or isNumeric($)
DataWeave
everyCharacter
everyCharacter(text: String, condition: (character: String) -> Boolean): Boolean
Checks whether a condition is valid for every character in a string.
Introduced in DataWeave version 2.4.0.
Parameters
Name | Description |
---|---|
|
The string to check. |
|
Expression that iterates through the characters in the string that it checks and returns a Boolean value. |
Example
This example determines whether a string is composed of only digits and spaces.
Source
Output
true
Json
everyCharacter(text: Null, condition: (character: Nothing) -> Any): true
Helper function that enables everyCharacter
to work with a null
value.
Introduced in DataWeave version 2.4.0.