using System.Collections; class Program { static void Main() { ArrayList arrayList = new ArrayList() { 1, 2, 3, 4, 5 }; arrayList.Remove(3); // Output: 1, 2, 4, 5 foreach (var item in arrayList) { Console.Write(item + " "); } } }
using System.Collections; class Program { static void Main() { ArrayList arrayList = new ArrayList() { "apple", "banana", "orange", "pear" }; arrayList.Remove("banana"); // Output: apple, orange, pear foreach (var item in arrayList) { Console.Write(item + " "); } } }Package library: System.Collections.