StringSome()
This function calls a given closure/function with every element in a given string and returns true, if one of the closure calls returns true.
Introduced: 6.0.0.126
StringSome( string=string, closure=function );
Returns: Boolean
Examples
myString="lucee";
callback=(x)=>x >= 'a';
writeDump(StringSome(myString, callback));
<span class="nv">callback_1</span><span class="o">=</span><span class="p">(</span><span class="nv">x</span><span class="p">)</span><span class="o">=></span><span class="nv">x</span> <span class="o">>=</span> <span class="s1">'z'</span><span class="p">;</span>
<span class="nf">writeDump</span><span class="p">(</span> <span class="nf">StringSome</span><span class="p">(</span><span class="nv">myString</span><span class="p">,</span><span class="nv">callback_1</span><span class="p">));</span>
See also
- string.some()
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)