【发布时间】:2013-03-27 19:25:10
【问题描述】:
我有一本字典
Dictionary<string, string> rList = new Dictionary<string, string>();
rList .Add("/a/b/c", "35");
rList .Add("/a/c/f/v", "25");
rList .Add("/a/r/d/c/r/v", "29");
rList .Add("/a", "21");
rList .Add("/a/f, "84");
我只想根据键中出现的“/”的数量对这个字典进行排序。我的预期输出是,
("/a/r/d/c/r/v", "29")
("/a/c/f/v", "25")
("/a/b/c", "35")
("/a/f, "84")
("/a", "21")
【问题讨论】:
-
这篇文章解释了你的问题stackoverflow.com/questions/15667684/…
-
@rajkumarts:你刚刚链接到这个问题。