日期:2014-05-18 浏览次数:20903 次
ArrayList arr1 = new ArrayList(new int[] { 3, 4, 5, 6, 7 }); ArrayList arr2 = new ArrayList(new int[] { 4, 5, 6, 7, 8 }); ArrayList result = new ArrayList(); foreach (int i in arr2) { if (arr1.Contains(i)) arr1.Remove(i); else result.Add(i); } result.AddRange(arr1); //查看结果 foreach (int i in result) richTextBox2.Text += i.ToString() + "\n";