StringSome

Tests whether any item in a string meets the specified callback

Method Signature

StringSome(list=[string], callback=[function:Predicate], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean], parallel=[boolean], maxThreads=[integer])

Arguments

Argument
Type
Required
Description
Default

list

string

true

callback

function:Predicate

true

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

true

parallel

boolean

false

false

maxThreads

integer

false

Examples

Full function

Are any of the characters in the string greater than our condition?

Run Example

instring = "abcdefg";
callback = ( Any inp ) => {
	return inp > "f";
};
writeoutput( StringSome( instring, callback ) );

Result: YES

Member function

Are any of the characters in the string greater than our condition?

instring = "abcdefg";
callback = ( Any inp ) => {
	return inp > "f";
};
writeoutput( instring.some( callback ) );

Result: YES

Additional Examples

Run Example

myString = "boxlang";
callback = ( Any x ) => x >= "a";;
writeDump( StringSome( myString, callback ) );
callback_1 = ( Any x ) => x >= "z";;
writeDump( StringSome( myString, callback_1 ) );

Last updated

Was this helpful?