Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
what would be the easiest/fastest way to convert Hash keys
Jarmo Pertman
1/7/2009 7:51:00 AM
Hello.
I was wondering, what would be the easiest and fastest way to convert
Hash keys from Symbol objects to String?
I came up with something like this, but I think that maybe there's some
better Ruby-way to do it:
tmp = {}
h.each_pair {|k, v| tmp[k.to_s] = v}
h = tmp
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
what would be the easiest/fastest way to convert Hash keys
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password