From: 7stud -- Date: 2011-04-20T03:17:02+09:00 Subject: Re: How can I do the dictionary? Siratinee Sukachai wrote in post #993714: > I am a newbie but I'm familial with C#. > I can't find any dictionary class in Ruby. > I need to do like Dictionary> > > Can I do that in Ruby? If yes, how? > Big thanks! my_hash = { 'fruits' => ['apple', 'pear'], 'cars' => ['VW', 'BMW', 'Ford'] } p my_hash['cars'] --output:-- ["VW", "BMW", "Ford"] my_hash['rocks'] = ['granite', 'quartzite'] p my_hash --output:-- {"fruits"=>["apple", "pear"], "cars"=>["VW", "BMW", "Ford"], "rocks"=>["granite", "quartzite"]} -- Posted via http://www.ruby-forum.com/.