string.listFirst()
Gets the first element of a list.
string.listFirst( delimiters=string, includeEmptyFields=boolean, count=number )
Returns: String
| Argument | Description |
|---|---|
|
delimiters
string,
optional
|
edit
Characters that separate list elements. The default value is comma. Alias: delimiter |
|
includeEmptyFields
boolean,
optional
|
edit
if set to true, empty values are included as well |
|
count
number,
optional
|
edit
specifies how many items to return from the beginning of the list. default is 1. |
Examples
edit listEx1 = "one&two&three&four";
writedump(listEx1.listfirst('&'));
writeoutput("<br>");
listEx2 = "dev,LAS,lucee";
writedump(listEx2.listfirst(''));