用于字符串的 c# 数据结构,<list> 类型数据

c# data structure to use for string, <list> type data

目前在 .net/c# 中存储由字符串和字符串列表构成的数据的最佳实践是什么?

数据形式为:

站点 1,字符串列表(urlA、urlB、urlC...第 N 个)

Site2,字符串列表(urlx、url...第 N 个)

如果字符串用作字符串列表的查找,您可以使用 Dictionary<string, List<string>>Lookup<string, string>

否则,创建一个小型类型来保存您的数据:

// or struct
class SomeMeaningfulName
{
    public string TheString { get; set; }
    public List<string> TheList { get; set; }
}