From: Lee Jarvis Date: 2008-04-27T01:55:07+09:00 Subject: Re: All occurances of a character in a string I apologise for the complete ugliness of this code :) Look away of you're screamish! ARGV.to_s.split(/\s*/).map{|x|x.downcase}.inject(Hash.new(0)){|h,x|h[x] +=1 and h}.each{|i,h| print "#{i}(#{h}), "} Foobar, output: a(1), b(1), o(2), f(1), r(1)