StringEvery()
Determines if all elements of a string satisfy a given condition.
Introduced: 6.0.0.105
StringEvery( string=string, closure=function );
Returns: Boolean
Examples
letters = "I love lucee";
callbackFunction = function(input){return input=="e";}
<span class="nv">result</span> <span class="o">=</span> <span class="nf">stringEvery</span><span class="p">(</span><span class="nv">letters</span><span class="p">,</span> <span class="nv">callbackFunction</span><span class="p">);</span>
<span class="nf">writeDump</span><span class="p">(</span><span class="nv">result</span><span class="p">);</span>
<span class="nv">result1</span> <span class="o">=</span> <span class="nf">stringEvery</span><span class="p">(</span><span class="s2">"Eee"</span><span class="p">,</span> <span class="nv">callbackFunction</span><span class="p">);</span>
<span class="nf">writeDump</span><span class="p">(</span><span class="nv">result1</span><span class="p">);</span>
See also
- string.every()
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)