ListLast()
Gets the last element of a list.
ListLast( list=string, delimiters=string, includeEmptyFields=boolean, count=number );
Returns: String
| Argument | Description | Default |
|---|---|---|
|
list
string,
required
|
edit
a string list |
|
|
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 |
false |
|
count
number,
optional
|
edit
specifies how many items to return from the end of the list. default is 1. |
1 |
Examples
edit//Simple Example
writeoutput(listLast("Susi ,LAS,,lucee,,,test"));
//Member Function
strList=",I,,love,lucee,,";
writeDump(strList.listLast());
See also
- Lists
- Strings
- string.listLast()
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)