# llListInsertList

*LSL function*

```lsl
list list llListInsertList(list dest, list src, integer start);
```

- `list dest`: Target destination list.
- `list src`: Source list to insert.
- `integer start`: Zero-based index where insertion begins.

- Returns: `list`
- Energy: 10

Returns a new list containing all elements of dest with the elements of src inserted starting at index start. Does not modify dest itself.

Returns a [list](https://wiki.secondlife.com/wiki/list) that contains all the elements from **dest** but with the elements from **src** inserted at position **start**.

```lsl title="How to use" frame="terminal"
list result = llListInsertList([], [], 0);
```

## Examples

<details open>
<summary>Example 1</summary>

```lsl collapse={1-8}
list numbers = [3, "three", 2, "two", 1, "one"];
default
{
    state_entry()
    {
        llOwnerSay(llDumpList2String(numbers, ","));
        // Object: 3,three,2,two,1,one
        integer index = llListFindList(numbers, [2]);
        if (index != -1)
        {
            numbers = llListInsertList(numbers, [2.5, "two and a half"], index);
            llOwnerSay(llDumpList2String(numbers, ","));
            // Object: 3,three,2.500000,two and a half,2,two,1,one
        }
    }
}
```

</details>

## Notes

Bear in mind that the source list will remain unchanged. Instead, a new list will be produced. So, it's important that you capture this with a variable (unless you are acting directly on the results.)

Tip! To insert something at the start of a list, you can just add the two lists (putting the list with the new item(s) first)

```lsl
list oldList = ["B", "C", "D"];
list newItem = ["A"];
list newlist = newItem + oldList;
```

## See also

### Functions

- [llDeleteSubList](/functions/llDeleteSubList/)
- [llList2List](/functions/llList2List/)
- [llListReplaceList](/functions/llListReplaceList/)

---

*Source: [LlListInsertList](https://wiki.secondlife.com/wiki/LlListInsertList) on the Second Life Wiki. Content from the Second Life Wiki articles LlListInsertList (revision 1194341, 2015-01-22), Template:LSLP (revision 1169053, 2012-06-13), Template:LSLGC (revision 1212351, 2022-09-24) and Template:LSL Function/negative index (revision 1200041, 2016-05-02), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llListInsertList/
