As usual Robert, you've shown me a very elegant way to handle this! Thanks!

Wayne


----- Original Message ----
From: Robert Klemme <shortcutter / googlemail.com>


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] += 1}
end

Kind regards

robert

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