List<int> list = new List<int>();
list.Add(1);
list.Add(2);
//list.Remove(1);//删除 1;
int[] ints={12,123,54,123};
list.AddRange(ints);
foreach (var item in list)
{
Console.Write(item+" ");
}
Console.WriteLine();
list.RemoveRange(2,4);
foreach (var item in list)
{
Console.Write(item+" ");
}
Console.ReadKey(); |