From: sharmin malik Date: 2012-09-10T00:05:26+09:00 Subject: Re: Match an ARray Element by if > > res2 =~ /^test1$/ its works fine sname << res1 sname.each { |item| if (item =~ /#{name}/) puts "its there" else "No tiem" end > What's the error message? a = ['Cat','Dog'] #if a.include? 'Dog1' if a.map(&:strip).include? 'Dog1' puts "yes" else puts "no" end array.rb:5: wrong argument type Symbol (expected Proc) (TypeError) -- Posted via http://www.ruby-forum.com/.