%w{ one two three }.inject(Array.new) { |a, e| if e !=
“three” then a <<
e else a end }
Since << is a modifying operation, the following also works …
%w{ one two three }.inject(Array.new) { |a, e| a << e if e != “three”; a }
···
–
– Jim Weirich / Compuware
– FWP Capture Services
– Phone: 859-386-8855