---
title: "what is partial operator in LINQ?"  
description: "what is partial operator in LINQ?"  
author: "Ethan Karla"  
published: 2021-09-24  
updated: 2021-09-24  
canonical: https://www.mindstick.com/forum/156761/what-is-partial-operator-in-linq  
category: "linq"  
tags: ["c#", "ado.net", "linq"]  
reading_time: 3 minutes  

---

# what is partial operator in LINQ?

how to use [LINQ](https://www.mindstick.com/articles/12007/language-integrated-query-linq-queries) [Partition](https://yourviews.mindstick.com/view/87414/who-was-responsible-for-the-1947-partition-and-massacre-gandi-nehru-or-jinnah) [Operators](https://www.mindstick.com/articles/716/php-operators) (Take, [Skip](https://www.mindstick.com/forum/159872/what-is-the-skip-and-take-combination-in-linq), TakeWhile, SkipWhile) in C#?

## Replies

### Reply by Ravi Vishwakarma

**Partial operators** are used to partial list/ collection into two parts and after using the partial list operator then return the one list value.

There are the following Partial Operators.

1. TAKE - Take( value )
2. TAKEWHILE - TakeWhile( Condition )
3. SKIP - Skip( value )
4. SKIPWHILE - SkipWhile( Condition )

## TAKE Operator

This operator is used to return a specific number of elements.

## TAKEWHILE Operator

This operator is used to return a specific number of elements at specific conditions.

## SKIP

This operator is used to skip a specific number of elements and return the remaining elements.

## SKIPWHILE

This operator is used to skip a specific number of elements at a specific condition and return the remaining elements.

## Example

```
using System;using System.Collections.Generic;using System.Linq;
public class Program{ public static void Main() {  List<Student> students = new List<Student>()  {  new Student() { StudentId = 1, Name = 'Ashu', Marks = 500 },  new Student() { StudentId = 2, Name = 'Shyam', Marks = 300 },  new Student() { StudentId = 3, Name = 'Shriyam', Marks = 400 },  new Student() { StudentId = 4, Name = 'Sunny', Marks = 550 },  new Student() { StudentId = 5, Name = 'Ram', Marks = 600 },  new Student() { StudentId = 6, Name = 'Krishna', Marks = 700 },  new Student() { StudentId = 7, Name = 'Anupam', Marks = 550 }  };
  var result = students.Take(3);  Console.WriteLine('\nTake() :\n');  Console.WriteLine('{0,-10} {1,10} {2,5}','Name', 'ID', 'Marks');  result.ToList().ForEach(item => Console.WriteLine('{0,-10} {1,10} {2,5}', item.Name, item.StudentId, item.Marks) );
  var result1 = students.Where( student => student.StudentId < 10).TakeWhile(s => s.Name.StartsWith('A'));  Console.WriteLine('\nTakeWhile() :\n');  Console.WriteLine('{0,-10} {1,10} {2,5}','Name', 'ID', 'Marks');  result1.ToList().ForEach(item => Console.WriteLine('{0,-10} {1,10} {2,5}', item.Name, item.StudentId, item.Marks) );
  var result2 = students.Skip(3);  Console.WriteLine('\nSkip() :\n');  Console.WriteLine('{0,-10} {1,10} {2,5}','Name', 'ID', 'Marks');  result2.ToList().ForEach(item => Console.WriteLine('{0,-10} {1,10} {2,5}', item.Name, item.StudentId, item.Marks) );
  var result3 = students.SkipWhile( s=> s.StudentId < 5);  Console.WriteLine('\nSkip() :\n');  Console.WriteLine('{0,-10} {1,10} {2,5}','Name', 'ID', 'Marks');  result3.ToList().ForEach(item => Console.WriteLine('{0,-10} {1,10} {2,5}', item.Name, item.StudentId, item.Marks) );
  Console.ReadLine(); }}
class Student{public int StudentId { get; set; }public string Name { get; set; }public int Marks { get; set; }}
```

## Output

```
Take() :
Name               ID MarksAshu                1   500Shyam               2   300Shriyam             3   400
TakeWhile() :
Name               ID MarksAshu                1   500
Skip() :
Name               ID MarksSunny               4   550Ram                 5   600Krishna             6   700Anupam              7   550
Skip() :
Name               ID MarksRam                 5   600Krishna             6   700Anupam              7   550
```


---

Original Source: https://www.mindstick.com/forum/156761/what-is-partial-operator-in-linq

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
