Skip to main content
Inspiring
August 17, 2009
Question

Extra Comma in Dynamic Generated Lists

  • August 17, 2009
  • 1 reply
  • 507 views

Is there an EASY minimal-code way to deal with extra an extra comma (or any delimeter) at the begining or end of a list when generating the list as follows?

Code:

<cfset ut_search = ut_search & "," & cResults[1].owner.id>

Result:

,6001,1206(I don't want the begining comma in the list)

Code:

<cfset ut_search = cResults[1].owner.id  & "," & ut_search>

Result:

6001,1206, (I don't want the trailing comma in the list)

    This topic has been closed for replies.

    1 reply

    jbreslowAuthor
    Inspiring
    August 17, 2009

    I am on fire today... answering my own questions left and right...

    <cfset ut_search = ListAppend(ut_search, cResults[1].owner.id, ",")>