• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 217
  • Last Modified:

Display CFLOOP results as a string

I am displaying cfloop results from a query but I don't want to put them in a list or a table.  I want them to be as a string separated with a comma.  So instead of the display looking like:
  Harrisburg
  Manhattan
  Dallas
I want it to display as this:
   Harrisburg, Manhattan, Dallas

The problem is, if I put the comma in my sentence it will display a comma after every record and I don't want the comma appearing after the last record.  

Not sure how to accomplish that...can this be done?
Cities changed from <cfloop query="getCurCityList">#City#</cfloop> to <cfloop query="getNewCityList">#City#</cfloop>

Open in new window

0
Lee R Liddick Jr
Asked:
Lee R Liddick Jr
1 Solution
 
erikTsomikSystem Architect, CF programmer Commented:
can you just do this
Cities changed from <cfloop query="getCurCityList">#City#</cfloop> to
<cfloop query="getNewCityList">#City#,</cfloop>
0
 
_agx_Commented:
Cities changed from
#ValueList(getCurCityList.City)# to
#ValueList(getNewCityList.City)#
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now