---
title: "How to remove an item from a list in C#?"  
description: "How to remove an item from a list in C#?"  
author: "Utpal Vishwas"  
published: 2023-07-06  
updated: 2023-07-07  
canonical: https://www.mindstick.com/forum/158978/how-to-remove-an-item-from-a-list-in-c-sharp  
category: "c#"  
tags: ["c#", "asp.net", ".net core"]  
reading_time: 2 minutes  

---

# How to remove an item from a list in C#?

How to [remove](https://yourviews.mindstick.com/story/4554/8-harmful-weeds-to-remove-from-garden) an [item](https://www.mindstick.com/forum/156564/remove-item-in-an-array-in-javascript) from a list in C#?

## Replies

### Reply by Aryan Kumar

Sure, there are a few ways to remove an item from a list in C#.

- **Using the** `Remove()` **method:** The `Remove()` method is a method that is defined on the `List` class. The `Remove()` method takes an item as its parameter and removes the first occurrence of that item from the list. For example, the following code will remove the item with the value "John Doe" from the list:

C#

```plaintext
var list = new List<string> { "John Doe", "Jane Doe", "Bill Smith" };
list.Remove("John Doe");
```

- **Using the** `RemoveAt()` **method:** The `RemoveAt()` method is a method that is also defined on the `List` class. The `RemoveAt()` method takes an index as its parameter and removes the item at that index from the list. For example, the following code will remove the item at index 0 from the list:

C#

```plaintext
var list = new List<string> { "John Doe", "Jane Doe", "Bill Smith" };
list.RemoveAt(0);
```

- **Using the** `Where()` **and** `Remove()` **methods:** The `Where()` method is a method that is defined on the `List` class. The `Where()` method takes a predicate as its parameter and returns a new list that contains only the items that satisfy the predicate. The `Remove()` method can then be used to remove the items from the new list. For example, the following code will remove all of the items from the list that start with the letter "J":

C#

```plaintext
var list = new List<string> { "John Doe", "Jane Doe", "Bill Smith" };
var filteredList = list.Where(item => item.StartsWith("J"));
filteredList.Remove();
```

Which method you use to remove an item from a list in C# will depend on your specific needs. If you know the item that you want to remove, then using the `Remove()` method is the simplest way to do it. If you need to remove an item based on its index, then using the `RemoveAt()` method is a better option. If you need to remove a group of items, then using the `Where()` and `Remove()` methods is a more efficient option.


---

Original Source: https://www.mindstick.com/forum/158978/how-to-remove-an-item-from-a-list-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
