From: Soul Surf Date: 2012-04-14T01:06:29+09:00 Subject: Re: How to test if array element exists? Ralf Mueller wrote in post #1056271: > On 04/13/2012 09:53 AM, Jan E. wrote: >> end >> > what about this > ?> array = [0,1,2,3] > => [0, 1, 2, 3] > >> array[4] > => nil > >> array[4].nil? > => true > >> array[444].nil? > => true > >> array[2].nil? > => false > >> thanks. i found part of my problem was [array[4]].nil? => false whereas array[4].nil? => true it was a syntax error. the .length is good also thanks -- Posted via http://www.ruby-forum.com/.