From: Martin DeMello Date: 2007-01-24T17:47:25+09:00 Subject: Re: search in array On 1/24/07, Giuseppe Milo wrote: > hi all > is there in ruby a method like in_array() php function? > > i need to verify if there is a string in an array array.include? string ri Array#include? --------------------------------------------------------- Array#include? array.include?(obj) -> true or false ------------------------------------------------------------------------ Returns +true+ if the given object is present in _self_ (that is, if any object +==+ _anObject_), +false+ otherwise. a = [ "a", "b", "c" ] a.include?("b") #=> true a.include?("z") #=> false martin