grep /[^g]/ : grep « Array « Ruby






grep /[^g]/


a = ["a", "b", "c", "d", "e", "f", "g", "h"]
p a.grep /[^g]/                    # => ["a", "b", "c", "d", "e", "f", "h"]

 








Related examples in the same category

1.Get array element by using grep
2.Start with 'p'
3.grep numbers