Whatever message this page gives is out now! Go check it out!
StringMap(String string, UDFMethod callback)Parameter | Description |
string | (Required) The input string. |
callback | (Optional) Closure or a function reference that will be called for each iteration. |
<cfscript>
myStr="123456789"; // ascii value of 1 is 49, 2 is 50 , and so on
closure=function(item){
return item+5;
}
writeOutput(myStr.map(closure)) // 545556575859606162
</cfscript><cfscript>
myString="Hello World"
closure=function(val){
return (val & 'a')
}
writeOutput(StringMap(callback=closure,string=myString)) // Haealalaoa aWaoaralada
</cfscript>