From: "yibin z." Date: 2012-07-02T16:21:40+09:00 Subject: how to sort this nested hash s = {'s1'=>{'hn1'=>{'15'=> {'m1'=> ['aa', 'bb'] }}}, 's3'=>{'hn2'=>{'10' => {'m2' => ['cc'] }}}, 's2'=>{'hn3'=>{'50'=> {'m3' => ['dd'] }}}} How to sort the above nested hash by keys like '15', '10', '50' shown above? The result should look like: {'s2'=>{'hn3'=>{'50'=> {'m3' => ['dd']}}}, 's1'=>{'hn1'=>{'15'=> {'m1'=> ['aa', 'bb'] }}}, 's3'=>{'hn2'=>{'10' => {'m2' => ['cc'] }}}} -- Posted via http://www.ruby-forum.com/.