From: "Jan E." Date: 2012-09-09T23:12:15+09:00 Subject: Re: Match an ARray Element by if Hi, It's probably a whitespace issue. Use "p sname" instead of "puts sname" to see how the array elements actually look like. And then you should strip the whitespace from the elements before you check for elements: sname.map(&:strip).include? 'test1' By the way, leave out this "Array.new". It's completely useless in the first case (since you immediately overwrite it) and can be replaced with the literal "[]" in the second case. -- Posted via http://www.ruby-forum.com/.