From: Josselin Date: 2007-08-17T17:50:04+09:00 Subject: Re: deleting an object in array, based on object.attribute On 2007-08-17 10:42:16 +0200, "Robert Klemme" said: > 2007/8/17, Josselin : >> I have an array anArray = [ object_1, object_2, ...... object_n] >> >> I would like to delete an object in it, if object.attribute_x = anInteger >> >> what is the dryest way to do it vs a C-style loop on each item of the array ? > > irb(main):001:0> %w{foo bar peter mountain}.delete_if {|s| s.length > 3} > => ["foo", "bar"] > > robert thanks Robert.. missed the delete_if { block } in reading my doc !