C# 在list的指定位置添加元素

使用Insert方法;

代码示例如下:

List<int> temp = new List<int>();

temp.Add(2);

temp.Add(3);

temp.Add(4);

temp.Insert(0,5);

temp结果为5,2,3,4