listintersect/3—determine the common elements in two lists


The listintersect/3 operation determines the common elements in two lists. The syntax for this function is as follows:

listintersect($LIST1,$LIST2,$LIST)
$LIST=listintersect($LIST1,$LIST2)

listintersect/3 arguments

Argument

Mode

Type

Description

$LIST1

Input

LIST_OF ANY

Specifies the first list to be compared

$LIST2

Input

LIST_OF ANY

Specifies the second list to be compared with the first list

$LIST

Output

LIST_OF ANY

List of common elements of $LIST1 and $LIST2

Use the listintersect/3 operation to construct a new list $LIST, which is the intersection of lists $LIST1 and $LIST2. The intersection of the two lists is the list that contains all the elements that are common to the two lists.

The elements in the two lists must be the same type.

listintersect/3 example

$MY_BAD_SLOTS=listintersect($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*