我想获得一个独特的,按字母顺序排列的行业名称(字符串)列表。这里是我的代码:列表排序编译错误
HashSet<string> industryHash = new HashSet<string>();
List<string> industryList = new List<string>();
List<string> orderedIndustries = new List<string>();
// add a few items to industryHash
industryList = industryHash.ToList<string>();
orderedIndustries = industryList.Sort(); //throws compilation error
最后一行抛出一个编译错误: “无法隐式转换类型‘无效’到“System.Collections.Generic.List”
我在做什么错?
当你在这,你可能也使用OrderedSet BTW。 http://msdn.microsoft.com/en-us/library/dd412070.aspx – C4stor