ListItemReplace
Jump to navigation
Jump to search
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Function: list ListItemReplace(list mylist, string element_old,string element_new );
Replaces a single occurrence of something in a list with something else that you specify.
See also: Lists
<lsl> list ListItemReplace(list mylist,string element_old, string element_new) {
integer placeinlist = llListFindList(mylist, [element_old]); list newlist = llListReplaceList(mylist, [element_new], placeinlist, placeinlist); return newlist;
} </lsl>
list myupdatedList = ListItemReplace(mylist,"Brown","Blue");