From: 7stud -- Date: 2008-02-07T06:54:19+09:00 Subject: Re: How to add string objects to hash? Todd Benson wrote: > On Feb 5, 2008 3:17 AM, dare ruby wrote: >> Thank you very much for your information. what you said is right. I want >> to put my strings into hash. But two objects are required for hash. Is >> it possibble to use hashcode method to be used as key and string as a >> value. >> >> If its possible please suggest a way to do so because i need to put my >> strings into a hash. > > The big question is "why?" It would be helpful if you could describe > your purpose. I don't see any value in using the #hash function as a > key. > > Todd Yeah, you're just creating a hash that looks like this: h = {'hello'=>'hello', 'goodbye'=>'goodbye'} -- Posted via http://www.ruby-forum.com/.