Skip to content

Instantly share code, notes, and snippets.

@Lahirutech
Created May 26, 2021 13:03
Show Gist options
  • Save Lahirutech/6d1dab56613781f8ab4c9edeb23cd469 to your computer and use it in GitHub Desktop.
Save Lahirutech/6d1dab56613781f8ab4c9edeb23cd469 to your computer and use it in GitHub Desktop.
var numbers = new List<int>(){ 10, 20, 30, 40, 10 };
numbers.Remove(10); // removes the first 10 from a list
numbers.RemoveAt(2); //removes the 3rd element (index starts from 0)
//numbers.RemoveAt(10); //throws ArgumentOutOfRangeException
foreach (var el in intList)
Console.Write(el); //prints 20 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment