如果我有:如何在C#中連接列表?
List<string> myList1;
List<string> myList2;
myList1 = getMeAList();
// Checked myList1, it contains 4 strings
myList2 = getMeAnotherList();
// Checked myList2, it contains 6 strings
myList1.Concat(myList2);
// Checked mylist1, it contains 4 strings... why?
我跑了類似下面的代碼在Visual Studio 2008,並在每次執行後設置斷點。在myList1 = getMeAList();
之後,myList1
包含四個字符串,然後我按下加號按鈕以確保它們不是全部空值。
myList2 = getMeAnotherList();
,myList2
之後包含六個字符串,我檢查以確保它們不爲空... myList1.Concat(myList2);
myList1僅包含四個字符串。這是爲什麼?
這是什麼用於斷點的公司嗎? – 2010-08-19 14:53:16