Whatever message this page gives is out now! Go check it out!

ListRest

Last update:
May 18, 2026

Description

Gets a list, without its first element.

Returns

A copy of list, without the first element. If list has one element, returns an empty list.

Category

Function syntax

ListRest(list [, delimiters, includeEmptyValues ])

See also

ListFirstListGetAtListLastLists in Data types- Developing guide in the Developing ColdFusion Applications

Parameters

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.

Usage

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.

Example

<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

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page