From: Arup Rakshit Date: 2013-02-01T16:01:30+09:00 Subject: Why Array#include? not working withone liner integer arrays? I was trying to write a one liner with integer array using array#include?,which is not working.But the same is good with character/string array. C:\>irb irb(main):001:0> a=[1,2,3] => [1, 2, 3] irb(main):002:0> a.include?(1) => true irb(main):003:0> a.include?(5) => false irb(main):004:0> [1,2,3].inculde?(1) NoMethodError: undefined method `inculde?' for [1, 2, 3]:Array from (irb):4 from C:/Ruby193/bin/irb:12:in `
' irb(main):007:0> b=[".vbs",".exe",".h"] => [".vbs", ".exe", ".h"] irb(main):008:0> b.include?(".rb") => false irb(main):009:0> [".vbs",".exe",".h"].include?(".rb") => false irb(main):010:0> [1,2,3].inculde?(1) NoMethodError: undefined method `inculde?' for [1, 2, 3]:Array from (irb):10 from C:/Ruby193/bin/irb:12:in `
' irb(main):011:0> Could you please if is it possible what I am looking for or I did the mistake? Thanks -- Posted via http://www.ruby-forum.com/.