Mwnci difference() Function

Syntax

difference(list1, list2, …)

Description

The difference() function returns an array with all elements of list1 that are not in any of the lists list2listn. If list1 is the NULL list, the result is the NULL list.

Duplicates are allowed in list1, and they appear in the return list in same order and number as they appeared in list1

Example

list1 = [1,2,3,4,5,6,7];
list2 = [3,4,5];
list3 = [4,5,6];
unique1 = difference(list1,list2,list3);
print("Elements unique to list1 : ",unique1);

Elements unique to list1 : [1, 2, 7]