This documentation is archived and is not being maintained.

List<T>.TakeWhile Method

Visual Studio 2008

Returns elements from a sequence as long as a specified condition is true, and then skips the remaining elements.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  NameDescription
Public Extension Method TakeWhile(Func<T, Boolean>) Returns elements from a sequence as long as a specified condition is true. (Defined by Enumerable.)
Public Extension Method TakeWhile(Func<T, Int32, Boolean>) Returns elements from a sequence as long as a specified condition is true. The element's index is used in the logic of the predicate function. (Defined by Enumerable.)
Top
Show: