Contact Us

 Bharat Patel     Feb,08 2017

ColdFusion Fastest String Concatenation Using CFSAVECONTENT

There are many way to concatenation string in coldfusion but there is one easiest way for that. it can be done using CFSAVECONTENT tag. It is faster than others.

<cfscript>str = "There is a content";str = str & " for concate a string.";writeoutput(str);</cfscript><cfscript>str = ArrayNew(1);str[1] = "There is a content";ArrayAppend(str," for concate a string.");str = ArrayToList(str, "");writeoutput(str);</cfscript><cfscript>str = "There is a content";str = ListAppend(str," for concate a string."," ");writeoutput(str);</cfscript> 

String concatenation using CFSAVECONTENT tag.

<cfsavecontent variable="str">There is a content for concate a string.<cfloop from="1" to="2" index="i">String Concating.....</cfloop></cfsavecontent><cfoutput>#str#</cfoutput>

Hope you may like this one just copy n paste in your cfm page for testing.