From: raphael teller Date: 2011-10-19T22:09:44+09:00 Subject: why doesn't this work? hey, I am a C programmer that decided to learn Ruby. I got some exercises to do, but I'm having some trouble in this (silly)one: Problem Statement Given a sentence containing multiple words, find the frequency of a given word in that sentence. i wrote the code below def find_frequency(sentence, word) array = Array.new array << sentence.split(/ /) array.delete_if {|i| i.to_s.downcase != word.downcase}.length end but it appears that (i.to_s.downcase) is always different from (word.downcase), even if the words are the same. can someone explain it to me, please? thanks -- Posted via http://www.ruby-forum.com/.