Forum: Ruby Re: How i can to parse string

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
87e9a89c53ccf984db792113471c2171?d=identicon&s=25 Kroeger, Simon (ext) (Guest)
on 2006-04-26 15:32
(Received via mailing list)
>
or

Hash[*str.split(/=|,/)]

cheers

Simon
1fba4539b6cafe2e60a2916fa184fc2f?d=identicon&s=25 unknown (Guest)
on 2006-04-26 19:21
(Received via mailing list)
Hi --

On Wed, 26 Apr 2006, Kroeger, Simon (ext) wrote:

>> David
>>
>
> or
>
> Hash[*str.split(/=|,/)]

Oh, right -- or that :-)  Another demonstration of the principle that
as one works on Ruby code it evaporates from the screen, *and* becomes
clearer rather than more cryptic.


David

--
David A. Black (dblack@wobblini.net)
Ruby Power and Light, LLC (http://www.rubypowerandlight.com)

"Ruby for Rails" PDF now on sale!  http://www.manning.com/black
Paper version coming in early May!
This topic is locked and can not be replied to.