ColdFusion and trailing comma

Gene R picture Gene R · Oct 8, 2008 · Viewed 10.8k times · Source

How do I remove a trailing comma from a string in ColdFusion?

Answer

Patrick McElhaney picture Patrick McElhaney · Oct 8, 2008

To remove a trailing comma (if it exists):

REReplace(list, ",$", "")

To strip one or more trailing commas:

REReplace(list, ",+$", "")