remove specific element from list c# code example
Example 1: how to delete from a list c#
var resultList = new List<int>();
resultList.Add(1);
resultList.Add(2);
resultList.Add(3);
resultlist.RemoveAt(0);
var itemToRemove = resultlist.Single(r => r.Id == 2);
resultList.Remove(itemToRemove);
Example 2: c# remove items from one list that are in another
destinationList = destinationList.Except(excludeList).ToList();
Example 3: c# remove item from list
list.Remove("Example String");
list.RemoveAt(3);
list.RemoveRange(6, 3);
Example 4: remove first object from list c#
listName.RemoveAt(0);