ListPrepend()

Inserts an element at the beginning of a list.

ListPrepend( list=string, value=string, delimiters=string, includeEmptyFields=boolean );

Returns: String

Argument Description Default
list
string, required

a string list

value
string, required

An element or a list of elements.

delimiters
string, optional

Characters that separate list elements. The default value is comma.

Alias: delimiter

,

includeEmptyFields
boolean, optional

if false it cleans up empty fields.

Introduced: 5.3.5.17

true

Examples

//Simple Example
writeoutput(listPrepend("Susi,LAS,,lucee,,,test","Inserted"));

//Member Function strList=",I,,love,lucee,,"; writeDump(strList.listPrepend("First"));

See also