LINQ Partition Operators (Take, Skip, TakeWhile, SkipWhile)

  Total Views : 261
  Comments : 0
 
  Keywords : How to use linq partition operators with examples, LINQ partition operators Take / Skip / Skipwhile / Takewhile with examples, Partition data using partition operators in linq with examples

Here we will learn linq partition operators in c#, vb.net with examples and different type of partitioning operators (take, takewhile, skip, skipwhile) to partition list or collection items in linq with examples.

LINQ Partition Operators

In LINQ partition operators are used to partition list / collection items into two parts and return one part of list items. Following are the different type of partition operators available in LINQ.

 

  1. TAKE
  2. TAKEWHILE
  3. SKIP
  4. SKIPWHILE

By using these partition operators we can partition list / collection items into two parts and return one part of list items as result.

 

Following table shows the more detailed information related to partition operators in LINQ.

 

OperatorDescriptionQuery Syntax
TAKE This operator is used to return specified number of elements in sequence Take
TAKEWHILE This operator is used to return the elements in sequence which satisfy the specified condition TakeWhile
SKIP This operator is used to skip specified number of elements in squence and return remaining elements Skip
SKIPWHILE This operator is used to skip elements in sequence based on the condition which is defined true SkipWhile

In coming chapters we will learn all these partition operators in detail with examples.

 Comments (0)

Be the first to give your valuable feedback

Leave a comment

  • Default Tutlane User