Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Ruby
is there a way of changing the key of a hash
M Karthik Raja
Programming language:
Ruby
2021-03-11 20:23:24
0
Q:
is there a way of changing the key of a hash
Andrew
Code:
Ruby
2021-07-08 10:48:32
hash.to_a.transpose.map(&:sort).transpose.to_h
1
Tags
key
Related
Sorting a Hash by Key or Value
change key value hash ruby
New to Communities?
Join the community