Forum: Ruby Re: setting nil to zero

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.
6087a044557d6b59ab52e7dd20f94da8?d=identicon&s=25 Peña, Botp (Guest)
on 2006-02-23 04:48
(Received via mailing list)
Logan Capaldo [mailto:logancapaldo@gmail.com] :

#    f[w] = f[w].to_i + 1

i felt like being the dumbest guy on earth <banging head>.
this one works for both arrays and hashes.
thank you for the uber cool tip, ruby hacker logan (though i have to
squinch my eyes a bit for that quick hack :)

thanks to all too and kind regards -botp
This topic is locked and can not be replied to.