> if I have a string like word1,word2,word3
>
> How could I split it in Cold Fusion into ?
>
> word1
> word2
> word3
You could use ListToArray if you want to save or use them elsewhere.
Something like:
<cfset words = ArrayNew(1)>
<cfset words = ListToArray(yourString,",")>
<!--- The delimiter is comma by default, so
<cfset words = ListToArray(yourString)> --->
If you just want to print:
word1
word2
word3
You could do something like
<cfset yourString = ListChangeDelims(yourString,"<br>",",")>
and then <cfoutput>#yourString#</cfoutput>
Dana Larose
Software Engineer
Canadian Web Design & Consulting Inc.
A: 701-281 McDermot Avenue (McDermot & King)
P: 204.946.5155
C: 204.228.0477
F: 204.946.5156
E: [EMAIL PROTECTED]
W: http://www.cdnwebdesign.com
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.