Mega Code Archive

 
Categories / Ruby / Array
 

Reject with block logic

a = ["a", "b", "c", "d", "e", "f", "g", "h"] p a.reject { |x| x < "e" }         # => ["e", "f", "g", "h"]