Logo

Programming-Idioms

History of Idiom 218 > diff from v8 to v9

Edit summary for version 9 by steenslag:
[C#] suspect wrong function

Version 8

2020-01-19, 00:56:09

Version 9

2020-01-19, 01:08:02

Idiom #218 List intersection

Create list c containing all unique elements that are contained in both lists a and b.
c should not contain any duplicates, even if a and b do.
The order of c doesn't matter.

Idiom #218 List intersection

Create list c containing all unique elements that are contained in both lists a and b.
c should not contain any duplicates, even if a and b do.
The order of c doesn't matter.

Extra Keywords
intersect and conjunction
Extra Keywords
intersect and conjunction
Imports
using System.Linq;
using System.Collections.Generic;
Imports
using System.Linq;
using System.Collections.Generic;
Code
c = a.Union(b).ToList();
Code
c = a.Union(b).ToList();
Comments bubble
Shouldn't it be Intersect, not Union ?