List<int> num = new List<int>(10){ 0, 1,2, 3, 4, 5, 6, 7, 8, 9 };List<int> a = new List<int>(3){ 2,3,6 };List<int> b = new List<int>(3){ 0,3,5 };num.Except(a.Union(b));foreach (int item in num){ DataGrid.Cell(1, 20).Text = num.ToString();}
上面这样写,错在哪里呢?谢谢
[解决办法]
[解决办法] for (int i = 0; i < result.Count; i++) { f.ListGrid.Cell(r, 20).Text = result[i].ToString(); } 这个都写出来了,哪怕是傻子也会举一反三了吧。 for (int i = 0; i < result.Count - 1; i++) { f.ListGrid.Cell(r, 20).Text = f.ListGrid.Cell(r, 20).Text + result[i].ToString() + ","; } f.ListGrid.Cell(r, 20).Text = f.ListGrid.Cell(r, 20).Text + result[result.Count - 1].ToString(); 如果你真的是在“学习”的话,就把这代码的意思看看清楚。