insert-item6.0.2

insert-item index list value insert-item index string1 string2

On a list, inserts an item in that list. index is the index where the item will be inserted. The first item has an index of 0. (The 6th item in a list would have an index of 5.)

Likewise for a string, but all characters in a multiple-character string2 are inserted at index.

show insert-item 2 [2 7 4 5] 15
=> [2 7 15 4 5]
show insert-item 2 "cat" "re"
=> "caret"

Take me to the full NetLogo Dictionary