StringEach
Iterates all the elements in a string and runs the passed callback on each character
Method Signature
StringEach(list=[string], callback=[function:Consumer], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean], parallel=[boolean], maxThreads=[integer], ordered=[boolean])
Arguments
Argument
Type
Required
Description
Default
list
string
true
callback
function:Consumer
true
The callback to execute
delimiter
string
false
,
includeEmptyFields
boolean
false
false
multiCharacterDelimiter
boolean
false
true
parallel
boolean
false
false
maxThreads
integer
false
ordered
boolean
false
false
Examples
Full function
letters = "ahqwz";
callback = ( Any inp ) => {
writeoutput( inp == "q" );
};
StringEach( letters, callback );
Result: NONOYESNONO
Member function
letters = "ahqwz";
letters.each( ( Any inp ) => {
writeoutput( inp == "q" );
} );
Result: NONOYESNONO
Additional Examples
inputString = "abcd";
stringEach( inputString, ( Any val ) => {
writeoutput( val == "c" );
} );
Related
Last updated
Was this helpful?