首页
微信
安卓
接口
移动
前端
专题
文档库
工具
网址
§
ITPOW
>>
文档
>>
C#
利用 SortedDictionary、SortedList 一句代码排序
作者:vkvi 来源:ITPOW
(原创)
日期:2018-3-1
Dictionary<string, string> items = new Dictionary<string, string>(); items.Add("b", "b"); items.Add("a", "a"); items.Add("c", "c"); // 用 SortedDictionary 排序 SortedDictionary<string, string> sitems = new SortedDictionary<string, string>(items); foreach (var item in sitems) { Response.Write(item.Key); // a、b、c } // 用 SortedList 排序 SortedList<string, string> sitems2 = new SortedList<string, string>(items); foreach (var item in sitems2) { Response.Write(item.Key); // a、b、c }
相关文章
创建于2005年
渝ICP备05010272号-1
电邮:
cftea@126.com
即将跳转...