ListRest

Returns the remainder of a list after removing the first item

Method Signature

ListRest(list=[string], delimiter=[string], includeEmptyFields=[boolean], offset=[integer])

Arguments

Argument
Type
Required
Description
Default

list

string

true

The delimited list to perform operations on

delimiter

string

false

string the list delimiter

,

includeEmptyFields

boolean

false

boolean whether to include empty fields in the returned result

false

offset

integer

false

0

Examples

Simple listRest Example

A very basic listRest example

Run Example

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

Result: two,three,four

Combining listRest to Shorten the List

Nesting listRest shortens the list by one each time with the first element removed.

Run Example

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

Result: three,four

Traversing a List with listRest and listFirst

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

Run Example

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

Result: three

Additional Examples

Run Example

writeOutput( listRest( "string,Boxlang,susi,LAS" ) & "<br><br>" );
// Member function
strList = "0,1,2,3,4";
writeDump( strlist.listRest() );

Last updated

Was this helpful?