ListXxorY
From Second Life Wiki
| LSL Portal | | | Functions | | | Events | | | Types | | | Operators | | | Constants | | | Flow Control | | | Script Library | | | Tutorials |
Function: list ListXnotY(list lx, list ly);
Returns a new list, composed of elements that were in either original script, but not both.
Note: This is not the same as getting rid duplicates by preserving just one of each duplicated item. It goes further, and removes both items.
See also: Lists
list ListXxorY(list lx, list ly) { // return elements that are in X or Y but not both return ListXnotY( lx, ly) + ListXnotY( ly, lx); }
Example:
list l1 = ["a","b","c","d"]; list l2 = ["a","1","b","2","c","3"]; default{ state_entry() { llSay(0, "Elements that are in x list or y list but not both: " + llList2CSV(ListXxorY(l1,l2))); //will say: d, 1, 2, 3 } }

