Skip to main content

Splice List Into List At Index

Adds the elements of the first list into the second starting from the index inputted, and then returns the new list.

Splice List Into List At Index block

Description

The Splice List Into List At Index block adds the elements of the first list into the second starting from the index inputted, and then returns the new list. This is a code block part of the Lists drawer.

Usage

Use Splice List Into List At Index to merge lists at specific positions. This is useful for combining data from multiple sources, inserting multiple elements at once, or building complex lists from component parts.

Syntax

Inputs:

  • A list (the source list to splice from)
  • A list (the target list to splice into)
  • A number (the index position to start insertion)

Notes

  • Returns the modified target list with all elements from the source list inserted
  • Elements after the insertion point are shifted to make room
  • All elements from the first list are inserted in order
  • List indices in StarLogo Nova start at 1