On Mon, Jan 28, 2013 at 6:55 PM, Jes=FAs Gabriel y Gal=E1n
<jgabrielygalan / gmail.com> wrote:

> res =3D Hash.new(0)
> string.downcase.scan(/\w+/) {|word| res[word] +=3D 1}
> return res

And to answer Wayne's question how to get rid of the "return":

Hash.new(0).tap do |res|
  string.downcase.scan(/\w+/) {|word| res[word] +=3D 1}
end

Kind regards

robert

--=20
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/