Description

Converts a one-dimensional array to a list.

Returns

Delimited list, as a string.

Category

Array functionsConversion functionsList functions

Function syntax

ArrayToList(array [, delimiter ])

Parameters

Parameter

Description

array

Name of array

delimiter

Character or multicharacter string to separate list elements. The default value is comma.

Example

<cfscript>
       // Declare an array
       myArray=["Google","Microsoft","Adobe","Facebook","Amazon"];
       myConvertedList=myArray.toList();
       WriteOutput(myConvertedList);
</cfscript>

Output

Google,Microsoft,Adobe,Facebook,Amazon

Example using member function

<cfscript>
       // Declare an array
       myArray=["Google","Microsoft","Adobe","Facebook","Amazon"];
       myConvertedList=myArray.toList();
       WriteOutput(myConvertedList);
</cfscript>

Output

Google,Microsoft,Adobe,Facebook,Amazon