From: Sebastian Hungerecker Date: 2008-10-16T23:36:19+09:00 Subject: Re: newbie to ruby, search an array Chris Ashton wrote: > array[count] returns x but array[count + 1] returns nil when i should be > y > > am i totally wrong or is it something else? Works here: >> array=["x","y"] => ["x", "y"] >> count=0 => 0 >> array[count] => "x" >> array[count+1] => "y" If array[count+1] does not return y for you that simply means, that y is not the value following x in your array. HTH, Sebastian -- Jabber: sepp2k@jabber.org ICQ: 205544826