Answers for "remove list from another list c#"

C#
25

how to delete from a list c#

var resultList = new List<int>();
resultList.Add(1);
resultList.Add(2);
resultList.Add(3);

// Removes the number 1 from the index 0 in the list
resultlist.RemoveAt(0);

// Allows you to remove an Object from the list instead
var itemToRemove = resultlist.Single(r => r.Id == 2);
resultList.Remove(itemToRemove);
Posted by: Guest on December-17-2019
1

c# remove items from one list that are in another

destinationList = destinationList.Except(excludeList).ToList();
Posted by: Guest on January-20-2021
0

remove items from one list in another c#

destionList.RemoveAll(x => sourceList.Exists(y => y.Id == x.Id));
Posted by: Guest on April-21-2021

Code answers related to "remove list from another list c#"

C# Answers by Framework

Browse Popular Code Answers by Language