本帖最后由 邓连超 于 2012-11-22 14:06 编辑
static void Main(string[] args)
{
string[] strs1 = { "a", "b", "c", "d", "e" };
string[] strs2 = { "d", "e", "f", "g", "h" };
ArrayList list1 = new ArrayList();
ArrayList list2 = new ArrayList();
list1.AddRange(strs1);
list2.AddRange(strs2);
for (int i = 0; i < list2.Count; i++)
{
if (!list1.Contains(list2))
{
list1.Add(list2);
}
Console.WriteLine(list1);
}
Console.ReadKey();
}
应该输出abcdefg的啊,怎么不对呢?
|
|