2012-07-08 65 views
-2

我有以下碼和陣列的引發劑中加入:在C#添加陣列以一個列表對象

var GraphList = new List<object>{ 
    new []{ "Year", "Sales", "Expenses"}, 
    new []{ "2010", "2012", "2001" }, 
    new []{ "80", "100", "200"} 

如何添加不使用構造即

GraphList.Add.new []{ "80", "100", "200"}; 

回答

4
一個新的數組

這應該工作(我認爲GraphList是在範圍內):

GraphList.Add(new []{ "80", "100", "200"}); 
4
GraphList.Add(new[] { "80", "100", "200" });