Skip to content

List Slice

The list::slice function extracts a portion of a list based on specified start and end indices.

Syntax

list::slice(<list>, <start-index>, <end-index>)

Parameters

  • list: The input list from which a portion will be extracted.
  • start-index: The starting index (inclusive).
  • end-index: The ending index (exclusive).

Returns

  • List: A new list containing elements from the specified range.

Example

Try it out below!
list::slice([1, 2, 3, 4, 5], 1, 4)

This function is useful for extracting specific portions of a list for analysis or processing.