miniapl

— Intersection

X∩Y keeps items of X found in Y. Order and repetitions are retained. Uses tolerant matching.

1 2 1 3∩1 3        ⍝ 1 1 3
'abcd'∩'bdf'        ⍝ 'bd'