From: Bertram Scharpf Date: 2009-09-15T12:14:42+09:00 Subject: Re: URL format Hi, Am Dienstag, 15. Sep 2009, 10:32:24 +0900 schrieb John W Higgins: > On Mon, Sep 14, 2009 at 5:58 PM, Re BR wrote: > > I have the following hash myhash > > { "inter" => "team", "shirt" => "stripe" } > > > > desired output > > > > inter=team&shirt=stripe > > The single line answer would be > > hsh = { "inter" => "team", "shirt" => "stripe" } > hsh.to_a.map{|e| e.join('=')}.join('&') # 'inter=team&shirt=stripe' The correct way escapes the `=' and `&' signs. I wrote my own library and it seems that it doesn't. Ugh. Bertram -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de