StringReduce()
Iterates over every element of the string and calls the closure to work on the elements of the string. This function will reduce the string to a single value and will return the value.
Introduced: 6.0.0.105
StringReduce( string=string, closure=function, initialVal=any );
Returns: any
Examples
letters="abcdef";
closure=function(value1,value2){return value1 & value2;}
writeOutput( stringReduce(letters,closure,"z") );
See also
- string.reduce()
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)