Luc*_*ero 10
Dictionary<string, List<DateTime>> dict = new Dictionary<string, List<DateTime>>();
Run Code Online (Sandbox Code Playgroud)
请注意,添加新项目时,需要为该值分配新列表:
string key; // assuming that's your key
List<DateTime> value;
if (!dict.TryGetValue(key, out value)) {
value = new List<DateTime>();
dict.Add(key, value);
}
// value is now always a valid instance
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
546 次 |
| 最近记录: |