我有這樣的數據結構:搜索嵌套列表<T>
List<string> sublist = new List<string>();
sublist.Add("university");
sublist.Add("organization");
List<List<string>> list = new List<List<string>>();
list.Add(sublist);
然後:
Conference c = new Conference();
c.Orgs = list;
我有會議對象的集合:
在此集合class Conference
{
private List<List<string>>_orgs;
public List<List<string>> Orgs
{
set { _orgs = value; } get { return _orgs; }
}
}
數據
List<Conference> listConferences = new List<Conference>();
listConferences.Add(c);
我想搜索像"uni"
這樣的字符串,並找到會議的集合有像"uni"
組織。我怎樣才能做到這一點?
也許你應該花一些努力讓代碼在發佈問題之前實際編譯。 – leppie
你確定你已經選擇了正確的數據結構來使用嗎?這看起來沒有什麼意義的IMO。 –
我有這樣的XML文件:'<有機碼 「一」>大學<有機碼 「B」> 123987Bn<有機碼 「一」>組織<有機碼 「B」> 465465465sf '我選擇從XML文件保存這個數據的結構比較簡單。文件名字和數字。你對結構的建議是什麼? –
TAIT