ListToArray(list [, delimiter ])
ColdFusion ignores empty list elements; thus, a list that is defined as "a,b,c,,,d" is treated as a four element list.
<!--- This example shows ListToArray ---> <html> <head> <title>ListToArray Example</title> </head> <body> <H3>ListToArray Example</H3> <!--- Find a list of users who wrote messages ---> <cfquery name = "GetMessageUser" datasource = "cfsnippets"> SELECT Username, Subject, Posted FROM Messages </cfquery> <cfset myList = ValueList(GetMessageUser.UserName)> <P>My list is a list with <cfoutput>#ListLen(myList)#</cfoutput> elements. <cfset myArrayList = ListToArray(myList)> <P>My array list is an array with <cfoutput>#ArrayLen(myArrayList)# </cfoutput> elements. </body> </html>