listFirst

Gets the first element of a list.

listFirst(list [, delimiters]) → returns string

Argument Reference

list string
Required

delimiters string
Default: ,

Examples
Sample code invoking the listFirst function

A very basic listFirst example

listFirst("one,two,three,four");

Expected Result: one

Nesting list functions lets you move through the list in pieces.

listFirst(listRest(listRest("one,two,three,four")));

Expected Result: three

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub