Saturday, January 5, 2013

something.include?(obj)


words = %w{cat, dog, sheep, bird}
puts words.include?("dog")
#=> true

puts words.incldue?("elephant")
#=> false

puts "the quick brown fox jumps over the lazy dog".include?("fox")
#=> true

No comments:

Post a Comment