MoreLinq
SkipUntil<(Of <(<'TSource>)>)> Method (source, predicate)
NamespacesMoreLinqMoreEnumerableSkipUntil<(Of <<'(TSource>)>>)(IEnumerable<(Of <<'(TSource>)>>), Func<(Of <<'(TSource, Boolean>)>>))
Skips items from the input sequence until the given predicate returns true when applied to the current source item; that item will be the last skipped.
Declaration Syntax
C#Visual BasicVisual C++
public static IEnumerable<TSource> SkipUntil<TSource>(
	this IEnumerable<TSource> source,
	Func<TSource, bool> predicate
)
<ExtensionAttribute> _
Public Shared Function SkipUntil(Of TSource) ( _
	source As IEnumerable(Of TSource), _
	predicate As Func(Of TSource, Boolean) _
) As IEnumerable(Of TSource)
public:
[ExtensionAttribute]
generic<typename TSource>
static IEnumerable<TSource>^ SkipUntil(
	IEnumerable<TSource>^ source, 
	Func<TSource, bool>^ predicate
)
Generic Template Parameters
TSource
Type of the source sequence
Parameters
source (IEnumerable<(Of <(<'TSource>)>)>)
Source sequence
predicate (Func<(Of <(<'TSource, Boolean>)>)>)
Predicate used to determine when to stop yielding results from the source.
Return Value
Items from the source sequence after the predicate first returns true when applied to the item.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable<(Of <(<'TSource>)>)>. When you use instance method syntax to call this method, omit the first parameter.
Remarks

SkipUntil differs from Enumerable.SkipWhile in two respects. Firstly, the sense of the predicate is reversed: it is expected that the predicate will return false to start with, and then return true - for example, when trying to find a matching item in a sequence.

Secondly, SkipUntil skips the element which causes the predicate to return true. For example, in a sequence

 Copy imageCopy
{ 1, 2, 3, 4, 5 }
and with a predicate of
 Copy imageCopy
x => x == 3
, the result would be
 Copy imageCopy
{ 4, 5 }
.

SkipUntil is as lazy as possible: it will not iterate over the source sequence until it has to, it won't iterate further than it has to, and it won't evaluate the predicate until it has to. (This means that an item may be returned which would actually cause the predicate to throw an exception if it were evaluated, so long as it comes after the first item causing the predicate to return true.)

Exceptions
ExceptionCondition
ArgumentNullExceptionsource or predicate is null

Assembly: MoreLinq (Module: MoreLinq.dll) Version: 1.0.16006.0 (1.0.16006.1845)