ListFirst()

Gets the first element of a list.

ListFirst( list=string, delimiters=string, includeEmptyFields=boolean, count=number );

Returns: String

Argument Description Default
list
string, required

a string list

delimiters
string, optional

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

Alias: delimiter

,

includeEmptyFields
boolean, optional

if set to true, empty values are included as well

false

count
number, optional

specifies how many items to return from the beginning of the list. default is 1.

1

Examples

writeOutput(listFirst("lucee,dev,LAS"));//Expected output lucee

//Member Function with @ delimiter strList="dev@LAS@lucee"; writeDump(strList.listFirst("@"));//Expected output dev

See also