insert

Description

Returns a list constructed by inserting the strings or lists into a specific position (indicated by an integer index) in the specified list. Note that 0 is the start of the list, 1 is between the first and second elements in the list, and so on.

If you specify an index number that is larger than the specified list, then the strings are placed at the end of the list.

Syntax

result = insert (list, index, list-or-string1 [, list-or-string2, ...])

Arguments

list Required. The original list.
index Required. The integer index.
list-or-string1 Required. The list or string to insert.
list-or-string2 Optional. The subsequent list(s) or string(s) to insert.

Return Values

A list.

trustedusers={"jamie", "cory", "tom"};
a=insert(trustedusers, 1, "leslie");

The example above sets the following to the list:

{"jamie", "leslie", "cory", "tom"}

For more information, see the following: