string.some()

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

string.some( closure=function )

Returns: Boolean

Argument Description
closure
function, optional

The value to find or a closure/function that gets every value of the array as input and returns true if the given value is right.

Alias: function, callback, udf

Examples

myString="lucee";
	callback=(x)=>x >= 'a';
	writeDump(myString.some(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">=&gt;</span><span class="nv">x</span> <span class="o">&gt;=</span> <span class="s1">&#39;z&#39;</span><span class="p">;</span>
<span class="nf">writeDump</span><span class="p">(</span> <span class="nf">myString.some</span><span class="p">(</span><span class="nv">callback_1</span><span class="p">));</span>

See also