From: "Aaron D. Gifford" Date: 2011-12-04T01:02:39+09:00 Subject: Re: Is there a better way to check this array? On Sat, Dec 3, 2011 at 5:43 AM, Isaac Sanders wrote: > Why u no use hash? I was wondering the same thing as Isaac. Your data seems quite well suited to a hash: irb(main):001:0> names = ['sue,5', 'tom,6', 'jim,7', 'sally,8', 'fred,9', 'barney,0'] => ["sue,5", "tom,6", "jim,7", "sally,8", "fred,9", "barney,0"] irb(main):002:0> hashnames = Hash[names.map{|x| x.split ','}] => {"sue"=>"5", "tom"=>"6", "jim"=>"7", "sally"=>"8", "fred"=>"9", "barney"=>"0"} irb(main):003:0> hashnames.key?('fred') => true Of course I understand you may have other reasons for not using a hash. But if your name comparisons will always be exact match comparisons, a hash is ideally suited for quick look-up. Aaron out.