











HastTable 沒有Sort
今天要用到Sort,於是google一下,發現有個方法可以達成
就是先以ArrayList將HastTable.Keys先排序後,再讀取HastTable就可以了
Sample code:
ArrayList aKeys = new ArrayList( words.Keys );
aKeys.Sort();
foreach ( string key in aKeys )
fwriter.WriteLine( "{0} :: {1}", key, words[ key ] );
This solves the final sticking point in our solution:
apron :: 1
around :: 1
blossoms :: 3
Reference URL : http://www.informit.com/articles/article.aspx?p=25322&seqNum=17&rl=1
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。