Listnumbers = new List { 1, 2, 3, 4, 5 }; numbers.RemoveRange(2, 2);
ListIn this example, the RemoveRange method is used to remove three items from the index position 1 in the names list. The resulting list would be [John]. Package Library: Microsoft.VisualStudio.TestTools.UnitTesting.names = new List { "John", "Emily", "David", "Maria" }; names.RemoveRange(1, 3);