Created
May 9, 2021 10:17
-
-
Save bennadel/d2e3d344304ae7fe358334006dd84c40 to your computer and use it in GitHub Desktop.
CFSaveContent Trim And Append Attributes In Lucee CFML 5.3.7.47
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- | |
In Lucee CFML, the CFSaveContent tag offers two additional attributes: | |
* trim - removes leading / trailing whitespace. | |
* append - adds the content to an existing variable. | |
---> | |
<cfsavecontent variable="data" trim="true"> | |
Roses are red, | |
</cfsavecontent> | |
<cfsavecontent variable="data" trim="true" append="true"> | |
Violets are blue, | |
</cfsavecontent> | |
<cfsavecontent variable="data" trim="true" append="true"> | |
Lucee is insanely powerful, | |
</cfsavecontent> | |
<cfsavecontent variable="data" trim="true" append="true"> | |
Deal with it! | |
</cfsavecontent> | |
<cfset comma = "," /> | |
<cfset commaWithLinebreak = ",#chr( 10 )#" /> | |
<cfoutput> | |
<pre>#data.replace( comma, commaWithLinebreak, "all" )#</pre> | |
</cfoutput> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment