Ruby/Array/reject
Материал из Wiki.crossplatform.ru
Версия от 17:10, 26 мая 2010; (Обсуждение)
reject the even ones
primes = [2,3,5,7] primes.reject {|x| x%2==0} # => [3,5,7]: reject the even ones
reject with block logic
a = ["a", "b", "c", "d", "e", "f", "g", "h"] p a.reject { |x| x < "e" } # => ["e", "f", "g", "h"]