Remove range from ArrayList
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
class Program {
static void Main(string[] args) {
ArrayList baseballTeams = new ArrayList();
baseballTeams.Add("s");
baseballTeams.Add("r");
baseballTeams.Add("i");
string[] myStringArray = new string[2];
myStringArray[0] = "t";
myStringArray[1] = "L";
baseballTeams.AddRange(myStringArray);
baseballTeams.RemoveRange(2, 2);
foreach (string item in baseballTeams) {
Console.Write(item + "\n");
}
Console.ReadLine();
}
}
Related examples in the same category