C#数据结构:我应该使用什么类型的集合?

use*_*676 1 c# collections data-structures

对于集合中的每个项目,我需要一个短字符串和一些int16字段.我想使用字符串字段迭代集合(意味着我不想使用数字索引进行迭代).该系列最多约10件.谢谢你的任何建议.

Bal*_*a R 7

我认为Dictionary<string, List<int>>应该适合你的需要.

Dictionary<string, List<int>> dictionary = new Dictionary<string, List<int>>();
dictionary.Add("key", new List<int>{1,2,3,4});
...
Run Code Online (Sandbox Code Playgroud)