stringSome

This function calls a given closure/function with every element in a given string and returns true as soon as the callback condition is met.

stringSome(inputString,callback) → returns boolean

Member Function Syntax

inputString.some(callback)

stringSome Argument Reference

inputString string
Required

Original input string to search.

callback function

The closure function that is executed for each element in the string.

Compatibility

Lucee:

Version 6+ This function is being added in Lucee 6. It is similar to other some() functions.

Links more information about stringSome

Examples sample code invoking the stringSome function

Are any of the characters in the string greater than our condition?

instring="abcdefg";
callback=function(inp){return inp > "f"}
writeoutput(StringSome(instring,callback));

Expected Result: YES

Are any of the characters in the string greater than our condition?

instring="abcdefg";
callback=function(inp){return inp > "f"}
writeoutput(instring.some(callback));

Expected Result: YES


Fork me on GitHub