string.every()
Determines if all elements of a string satisfy a given condition.
Introduced: 6.0.0.105
string.every( closure=function )
Returns: Boolean
| Argument | Description |
|---|---|
|
closure
function,
required
|
edit
Closure or a function reference that will be called for each of the iteration. Alias: function, callback, udf |
Usage Notes
editSince Lucee 6, this function iterates over each character in the string.
For list-based iteration with delimiters, use string.listEvery() instead.
Examples
edit letters = "I love lucee";
callbackFunction = function(input){return input=="e";}
result = letters.every(callbackFunction);
writeDump(result);
result1 = "Eee".every(callbackFunction);
writeDump(result1);