Contact Us 1-800-596-4880

someCharacter

someCharacter(text: String, condition: (character: String) -> Boolean): Boolean

Checks whether a condition is valid for at least one of the characters or blank spaces in a string.

Introduced in DataWeave version 2.4.0.

Parameters

Name Description

text

The string to check.

condition

Expression that iterates through the characters and spaces in the string and returns a Boolean value.

Example

This example determines whether a string has any uppercase characters.

Source

%dw 2.0
import someCharacter from dw::core::Strings
output application/json
---
"someCharacter" someCharacter isUpperCase($)

Output

true

someCharacter(text: Null, condition: (character: Nothing) -> Any): false

Helper function that enables someCharacter to work with a null value.

Introduced in DataWeave version 2.4.0.