Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

ruby hash transform keys

hash = { name: 'Rob', age: '28' }

hash.transform_keys{ |key| key.to_s.upcase }
# => { "NAME" => "Rob", "AGE" => "28" }
Source by apidock.com #
 
PREVIOUS NEXT
Tagged: #ruby #hash #transform #keys
ADD COMMENT
Topic
Name
8+5 =