Gets a list, without its first element.
A copy of list, without the first element. If list has one element, returns an empty list.
ListRest(list [, delimiters, includeEmptyValues ])
ListFirst, ListGetAt, ListLast; Lists in Data types- Developing guide in the Developing ColdFusion Applications
Parameter |
Description |
|---|---|
includeEmptyValues |
Optional. Set to yes to include empty values. |
list |
A list or a variable that contains one. |
delimiters |
A string or a variable that contains one. Characters that separate list elements. The default value is comma. If this parameter contains more than one character, ColdFusion processes each occurrence of each character as a delimiter. |
If the list begins with one or more empty entries, this function drops them, as well as the first element. ColdFusion ignores empty list elements; thus, the list "a,b,c,,,d" has four elements.

<cfscript>
// case 1
myList="Delhi,Mumbai,Bangalore,Chennai"
rest=ListRest(myList)
writeOutput(rest & "<br/>")
// case 2- using delimiter
myList1="Delhi;Mumbai:Bangalore,Chennai"
rest1=ListRest(myList1,";:,")
writeOutput(rest1)
</cfscript>
Output
Mumbai,Bangalore,Chennai
Mumbai:Bangalore,Chennai
Sign in to your account