Skip to content
lsl.devlsl.devLSL Dev

llDeleteSubList

function
Function syntax
list llDeleteSubList(
  1. list src,// Source list to copy and modify.
  2. integer start_index,// Starting index of the slice to remove (inclusive).
  3. integer end_index// Ending index of the slice to remove (inclusive).
);
Returns
list
Energy
10

While the function result is different than src, src is not modified, remember to use or store the result of this function.

The opposite function would be llListInsertList.

Returns a list that is a copy of src but with the slice from start to end removed.

How to use
list result = llDeleteSubList([], 0, 0);
Example 1
src = llDeleteSubList( src, start, end )
Example 2
6 collapsed lines
default
{
state_entry()
{
// Create a list of names
list names = ["Anthony", "Bob", "Charlie", "Diane", "Edgar", "Gabriela"];
// Now let's remove values at position 1 through 2.
names = llDeleteSubList(names, 1, 2);
// Result:
// list names = ["Anthony", "Diane", "Edgar", "Gabriela"];
// Now let's use an start number higher then our end number
names = llDeleteSubList(names, 3, 1);
// Result:
// list names = ["Edgar"];
// If start number higher then our end number, then we should imagine that the start and the end are missing before start and end.
// Imagine it should be FROM_THE_LISTSTART_CUT: start, AND_FROM_THE_LISTEND_CUT: end ... more or less :))
// names = llDeleteSubList(names, 3 -> , <- 1);
}
}
Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.