davelowndes
asked on
how do escape a comma in a comma-delimited list
I want to create a comma delimited list that contains a comma as one of the elements. How do I do this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi
u can put all data inside as test so put chr(34) before and after text while building of text.
chr(34) for "
chr(44) for ,
<cfset textstr = "#textstr#" & Chr(34) & "#product_name#" & Chr(34) & "#Chr(44)#">
u can put all data inside as test so put chr(34) before and after text while building of text.
chr(34) for "
chr(44) for ,
<cfset textstr = "#textstr#" & Chr(34) & "#product_name#" & Chr(34) & "#Chr(44)#">
For example:
<cfset TheList="value1,value2,@Co
<cfloop list="#TheList#" index="i">
<cfset StringItem = #Replace(i, "@Comma@", ",", "ALL")#>
<cfoutput>#StringItem#</cf
</cfloop>