110,538
社区成员
发帖
与我相关
我的任务
分享
int[] arr = new int[] { 1, 2, 3, 4, 5, 6 };
ArrayList List = new ArrayList(arr);
List.Remove(1);
foreach (int i in List)
Console.Write(i + " ");
int[] arr = new int[] { 1, 2, 3, 4, 5, 6 };
ArrayList List = new ArrayList(arr);
List.Remove(1);//此处,按你的想法应该调用RemoveAt()。Remove是删除列表中对应的项,RemoveAt删除对应索引的项。
foreach (int i in List)
Console.Write(i + " ");