Solved

Add a space after commas in a coldfusion string

Posted on 2013-01-17
2
671 Views
Last Modified: 2013-01-17
I have a select box that allows the user to choose multiple choices and then my cfoutput code writes this to the page. It outputs the choices separated by a comma but no space after the comma. The choice with multiples is "usernames". Right now they show as: username1,username2,username3 etc... I'd like: username1, username2, username3 etc..

I'd like to add a space after each comma. Thank you.

<cfoutput><p>User Names: #usernames#  Range: #StDate# - #EdDate#</p></cfoutput>

Open in new window

0
Comment
Question by:earwig75
2 Comments
 
LVL 13

Expert Comment

by:ansudhindra
Comment Utility
use can use replace function

like
<cfset updatedString = replace(usernames,",",", ","All") />
0
 
LVL 39

Accepted Solution

by:
gdemaria earned 500 total points
Comment Utility
listChangeDelims(usernames,", ")

note there is a space in the quotes:  ",_"   where _ is the space
0

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

Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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