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

Run Example

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

Run Example

inputString = "abcd";
stringEach( inputString, ( Any val ) => {
	writeoutput( val == "c" );
} );

Last updated

Was this helpful?