This function uses the callback to filter the elements in a string.
stringFilter(string,callback)
→ returns string
string.filter(callback)
.filter()
functions.
Return only the letters in the string that meet the callback condition.
letters="zzQQZ";
callback=function(inp){return inp=="z";}
onlyZs = StringFilter(letters,callback);
writeOutput(onlyZs);
Expected Result: zzZ
Return only the letters in the string that meet the callback condition.
letters="zzQQZ";
callback=function(inp){return inp=="z";}
onlyZs = letters.filter(callback);
writeOutput(onlyZs);
Expected Result: zzZ
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.