Link to home
Start Free TrialLog in
Avatar of Lee R Liddick Jr
Lee R Liddick JrFlag for United States of America

asked on

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

Avatar of erikTsomik
erikTsomik
Flag of United States of America image

can you just do this
Cities changed from <cfloop query="getCurCityList">#City#</cfloop> to
<cfloop query="getNewCityList">#City#,</cfloop>
ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial