---
title: "Why are use the LINQ Except Method, give an example of Except method."  
description: "Why are use the LINQ Except Method, give an example of Except method."  
author: "Ethan Karla"  
published: 2021-09-24  
updated: 2021-09-24  
canonical: https://www.mindstick.com/forum/156770/why-are-use-the-linq-except-method-give-an-example-of-except-method  
category: "linq"  
tags: ["c#", "ado.net", "linq"]  
reading_time: 1 minute  

---

# Why are use the LINQ Except Method, give an example of Except method.

Why are use the [LINQ](https://www.mindstick.com/articles/12007/language-integrated-query-linq-queries) [Except](https://www.mindstick.com/blog/144/union-intersection-and-except-operator-in-sql-server) [Method](https://www.mindstick.com/forum/166/webservice-method), give an example of Except method.

## Replies

### Reply by Ravi Vishwakarma

In LINQ, the **Except** method or operator is used to return only these elements from the first collection or list which are not present in the second collection or list. in another word first collection elements are doesn't present in the second collection then return the remaining first collection element.

## Syntax

```
collection1.Except(collection2)
```

## Example

```
using System;
using System.Collections.Generic;
using System.Linq;
public class Program
{
 public static void Main()
 {
  List<string> count1= new List<string>() { 'UK', 'Australia', 'India', 'USA' };
  List<string> count2 = new List<string>() { 'India', 'UAE', 'Canada', 'UK', 'China', 'Pok' };
  List<string> list = count1.Except(count2).ToList();
  list.ForEach( country => Console.WriteLine(country) );
  Console.ReadLine();
 }
}
```

## Output

```
Australia
USA
```


---

Original Source: https://www.mindstick.com/forum/156770/why-are-use-the-linq-except-method-give-an-example-of-except-method

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
