method

grep_v

Importance_1
v2_4_6 - Show latest stable - 0 notes - Class: Enumerable
grep_v(p1) public

Inverted version of Enumerable#grep. Returns an array of every element in enum for which not Pattern === element.

(1..10).grep_v 2..5   #=> [1, 6, 7, 8, 9, 10]
res =(1..10).grep_v(2..5) { |v| v * 2 }
res                    #=> [2, 12, 14, 16, 18, 20]
Show source
Register or log in to add new notes.