Filters a sequence of values based on a predicate.
Each element's index is used in the logic of the predicate function.
Namespace: SequencesAssembly: Sequences (in Sequences.dll) Version: 1.0.1.0 (1.0.1)
Syntax public static ISequence<TSource> Where<TSource>(
this ISequence<TSource> source,
Func<TSource, int, bool> predicate
)
public static ISequence<TSource> Where<TSource>(
this ISequence<TSource> source,
Func<TSource, int, bool> predicate
)
<ExtensionAttribute>
Public Shared Function Where(Of TSource) (
source As ISequence(Of TSource),
predicate As Func(Of TSource, Integer, Boolean)
) As ISequence(Of TSource)
<ExtensionAttribute>
Public Shared Function Where(Of TSource) (
source As ISequence(Of TSource),
predicate As Func(Of TSource, Integer, Boolean)
) As ISequence(Of TSource)
public:
[ExtensionAttribute]
generic<typename TSource>
static ISequence<TSource>^ Where(
ISequence<TSource>^ source,
Func<TSource, int, bool>^ predicate
)
public:
[ExtensionAttribute]
generic<typename TSource>
static ISequence<TSource>^ Where(
ISequence<TSource>^ source,
Func<TSource, int, bool>^ predicate
)
static member Where :
source : ISequence<'TSource> *
predicate : Func<'TSource, int, bool> -> ISequence<'TSource>
static member Where :
source : ISequence<'TSource> *
predicate : Func<'TSource, int, bool> -> ISequence<'TSource>
Parameters
- source
- Type: Sequences ISequence TSource
A sequence to filter.
- predicate
- Type: System Func TSource, Int32, Boolean
A function to test each element and its index for a condition.
Type Parameters - TSource
- The type of the elements of source.
Return Value
Type:
ISequence TSource A sequence that contains elements from
source that satisfy the condition.
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