2015년 9월 21일 월요일

[ C# ] Dictionary sort 하기

[ C# ]  Dictionary sort 하기
List<KeyValuePair<string, string>> myList = aDictionary.ToList();
myList.Sort(
    delegate(KeyValuePair<string, string> firstPair,
    KeyValuePair<string, string> nextPair)
    {
        return firstPair.Value.CompareTo(nextPair.Value);
    }
);

http://stackoverflow.com/questions/289/how-do-you-sort-a-dictionary-by-value

댓글 없음:

댓글 쓰기