Link to home
Start Free TrialLog in
Avatar of earwig75
earwig75

asked on

Add a space after commas in a coldfusion string

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

Avatar of Sudhindra A N
Sudhindra A N
Flag of India image

use can use replace function

like
<cfset updatedString = replace(usernames,",",", ","All") />
ASKER CERTIFIED SOLUTION
Avatar of gdemaria
gdemaria
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