August 2001
Intermediate to advanced
976 pages
38h 8m
English
ListToArray
ListToArray(list[,delimiters])
Converts a ColdFusion list to a one-dimensional array. An optional delimiter can be specified if the list is delimited with a character other than the comma (the default). Here’s an example that converts a list containing the days of the week to a one-dimensional array:
<CFSET MyList = "Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday"> <CFSET MyArray = ListToArray(MyList)> <CFLOOP INDEX="Element" FROM="1" TO="#ArrayLen(MyArray)#"> <CFOUTPUT>Element #Element#: #MyArray[Element]#<BR></CFOUTPUT> </CFLOOP>
Read now
Unlock full access