IEnumerable<T>.Union Method
Overloads
| Union(IEnumerable<T>) |
Produces the set union of two sequences by using the default equality comparer. |
| Union(IEnumerable<T>, IEqualityComparer<T>) |
Produces the set union of two sequences by using a specified equality comparer. |
Produces the set union of two sequences by using the default equality comparer.
Delphi
function Union(const second: IEnumerable<T>): IEnumerable<T>
Parameters
- second
- IEnumerable<T>
A sequence whose distinct elements form the second set for the union.
Returns
IEnumerable<T>
A sequence that contains the elements from both input sequences, excluding duplicates.
Exceptions
second is nil .
Produces the set union of two sequences by using a specified equality comparer.
Delphi
function Union(const second: IEnumerable<T>; const comparer: IEqualityComparer<T>): IEnumerable<T>
Parameters
- second
- IEnumerable<T>
A sequence whose distinct elements form the second set for the union.
- comparer
- IEqualityComparer<T>
An equality comparer to compare values.
Returns
IEnumerable<T>
A sequence that contains the elements from both input sequences, excluding duplicates.
Exceptions
second is nil .