Parameter
Iterates over every element of the string and calls the closure to work on the elements of the string. This function will reduce the string to a single value from the right to left, and will return the value.
Any
StringReduceRight(array, function(result, item, [,index, array])[, initialValue])
ColdFusion (2021 release): Added in this release.
|
Parameter |
Description |
|---|---|
|
string |
(Required) The input string |
|
function |
(Required) Closure or a function reference that will be called for each of the iteration. |
|
initialVal |
(Optional) Initial value that will be used for the reduce operation. The type is any. |
<cfscript>
myStr="1202";
closure=function(value1,value2){
return (value1 & value2);
}
writeOutput(StringReduceRight(myStr,closure,"ColdFusion "))
</cfscript>
ColdFusion 2021
<cfscript>
myStr="1202";
closure=function(value1,value2){
return (value1 & value2);
}
writeOutput(myStr.reduceRight(closure,"ColdFusion"))
</cfscript>
ColdFusion2021
Sign in to your account