Set Intersection

Calculates the intersection of two sets.

Input: TextResult: Text

Text input

Tool options

Examples

Set Intersection

Input

1 2 3 4 5

3 4 5 6 7

Expected answer

3 4 5
Sample delimiter
Item delimiter
duplicates in both sets

Input

1 1 2 2 3

2 2 3 3 4

Expected answer

2 3
Sample delimiter
Item delimiter
duplicates in first set are removed

Input

red,red,blue

red,blue

Expected answer

red,blue
Sample delimiter
Item delimiter
,
item delimiter

Input

1-2-3-4-5

3-4-5-6-7

Expected answer

3-4-5
Sample delimiter
Item delimiter
-
only one set

Input

1 2 3 4 5 6 7 8

Expected rejection

Message contains
Incorrect number of sets, perhaps you need to modify the sample delimiter or add more samples?
Sample delimiter
Item delimiter
sample delimiter

Input

1-2-3-4-5z3-4-5-6-7

Expected answer

3-4-5
Sample delimiter
z
Item delimiter
-

Format reference: Set Intersection background and specification

Parameters

ParameterDefault valueInput and choices
Sample delimiter"\\n\\n"Escape sequences such as \n, \r and \t are supported
Item delimiter","Escape sequences such as \n, \r and \t are supported

Related tools

Browse arithmetic / logic tools