Produces the set intersection of two sequences by using the specified
IEqualityComparer T to compare values.
If the second sequence represents an infinite set or series, this will never return!
Namespace: SequencesAssembly: Sequences (in Sequences.dll) Version: 1.0.1.0 (1.0.1)
Syntax public static ISequence<TSource> Intersect<TSource>(
this ISequence<TSource> first,
IEnumerable<TSource> second,
IEqualityComparer<TSource> comparer
)
public static ISequence<TSource> Intersect<TSource>(
this ISequence<TSource> first,
IEnumerable<TSource> second,
IEqualityComparer<TSource> comparer
)
<ExtensionAttribute>
Public Shared Function Intersect(Of TSource) (
first As ISequence(Of TSource),
second As IEnumerable(Of TSource),
comparer As IEqualityComparer(Of TSource)
) As ISequence(Of TSource)
<ExtensionAttribute>
Public Shared Function Intersect(Of TSource) (
first As ISequence(Of TSource),
second As IEnumerable(Of TSource),
comparer As IEqualityComparer(Of TSource)
) As ISequence(Of TSource)
public:
[ExtensionAttribute]
generic<typename TSource>
static ISequence<TSource>^ Intersect(
ISequence<TSource>^ first,
IEnumerable<TSource>^ second,
IEqualityComparer<TSource>^ comparer
)
public:
[ExtensionAttribute]
generic<typename TSource>
static ISequence<TSource>^ Intersect(
ISequence<TSource>^ first,
IEnumerable<TSource>^ second,
IEqualityComparer<TSource>^ comparer
)
static member Intersect :
first : ISequence<'TSource> *
second : IEnumerable<'TSource> *
comparer : IEqualityComparer<'TSource> -> ISequence<'TSource>
static member Intersect :
first : ISequence<'TSource> *
second : IEnumerable<'TSource> *
comparer : IEqualityComparer<'TSource> -> ISequence<'TSource>
Parameters
- first
- Type: Sequences ISequence TSource
A sequence whose distinct elements that also appear in second will be returned.
- second
- Type: System.Collections.Generic IEnumerable TSource
A sequence whose distinct elements that also appear in the first sequence will be returned.
- comparer
- Type: System.Collections.Generic IEqualityComparer TSource
Type Parameters - TSource
- The type of the elements of the input sequences.
Return Value
Type:
ISequence TSource A sequence that contains the elements that form the set intersection of two sequences.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
ISequence TSource . When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also