MoreEnumerableSkipLastWhileT Method

Removes elements from the end of a sequence as long as a specified condition is true.

Definition

Namespace: MoreLinq
Assembly: MoreLinq (in MoreLinq.dll) Version: 4.4.0+6d97c3b1d482f98300f4446df14742b0e3fafbec
C#
public static IEnumerable<T> SkipLastWhile<T>(
	this IEnumerable<T> source,
	Func<T, bool> predicate
)

Parameters

source  IEnumerableT
The source sequence.
predicate  FuncT, Boolean
The predicate to use to remove items from the tail of the sequence.

Type Parameters

T
Type of the source sequence.

Return Value

IEnumerableT
An IEnumerableT containing the source sequence elements except for the bypassed ones at the end.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableT. 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).

Remarks

This operator uses deferred execution and streams its results. At any given time, it will buffer as many consecutive elements as satisfied by predicate.

Exceptions

ArgumentNullExceptionThe source sequence is .
ArgumentNullExceptionThe predicate is .

See Also