Display CFLOOP results as a string

Posted on 2009-04-29
Last Modified: 2013-12-24
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:
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

Question by:Lee R Liddick Jr
    LVL 19

    Expert Comment

    can you just do this
    Cities changed from <cfloop query="getCurCityList">#City#</cfloop> to
    <cfloop query="getNewCityList">#City#,</cfloop>
    LVL 51

    Accepted Solution

    Cities changed from
    #ValueList(getCurCityList.City)# to

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Article by: kevp75
    Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
    When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now