0
我創建了一個HashSet對象的HashSet對象檢索數據:從類型列表<string>
HashSet<List<string>> objHS = new HashSet<List<string>>();
,然後我動態地創建多個列表即(List<string> lst = new List<string>())
。
我可以在objHS中添加這些列表,例如(objHS.Add(lst))
。現在,由於有多個 列表,它們中的每一個都將具有索引號。在objHS。我用循環所以,我可以跟蹤列表。這是我面臨的問題,我無法從objHS中檢索這些列表的值。
代碼: -
for (int intlstcols = 0; intlstcols < intCols; intlstcols++)
{
List<string> lstCommon = new List<string>();
for (int intlstrows = 0; intlstrows < intRows; intlstrows++)
{
lstCommon.Add(sheetEntries[intlstrows, intlstcols]);
}
objHS.Add(lstCommon);
}
如果您發佈了代碼段,它將有助於人們更好地幫助您。 – Aravind 2011-05-23 06:53:17