This function calls a given closure/function with every element in a given string list and returns true, if one of the closure calls returns true.
listSome(list, closure [, delimiter] [, includeEmptyFields] [, multiCharacterDelimiter] [, parallel] [, maxThreads])
→ returns boolean
list.listSome(closure [, delimiter] [, includeEmptyFields] [, multiCharacterDelimiter] [, parallel] [, maxThreads])
value
*
any
:
current value from the list
index
*
numeric
:
position in the list
list
*
string
:
string list to iterate
delimiter
*
string
:
delimiter used to separate the string list
,
false
true
false
20
Take a string list and see if some elements match a given predicate.
var fruitList = arrayToList(["apple", "mango", "orange", "pear"], ",");
writeOutput(listSome(fruitList, function(fruit) {
return findNoCase("n", fruit);
}, ","));
Expected Result: true
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.