listsubtract/3—remove the elements that occur in one list from another list
The listsubtract/3 operation removes the elements that occur in one list from another list. The syntax for this function is as follows:
listsubtract($LIST1,$LIST2,$LIST)
$LIST=listsubtract($LIST1,$LIST2)
$LIST=listsubtract($LIST1,$LIST2)
listsubtract/3 arguments
Argument | Mode | Type | Description |
---|---|---|---|
$LIST1 | Input | LIST_OF ANY | Specifies the list from which elements are to be removed |
$LIST2 | Input | LIST_OF ANY | Specifies the list of elements that are to be removed from $LIST1 |
$LIST | Output | LIST_OF ANY | List resulting from removing the elements of $LIST2 from $LIST1 |
Use the listsubtract/3 operation to construct a new list $LIST that contains all the elements from list $LIST1 that do not occur in $LIST2.
The elements in the two lists must be the same type.
listsubtract/3 example
$MY_BAD_SLOTS=listsubtract($E.mc_bad_slot_names,[my_slot1,my_slot2]);
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*