Skip to content

Instantly share code, notes, and snippets.

View peterromfeldhk's full-sized avatar

Peter Romfeld peterromfeldhk

View GitHub Profile
@miketheman
miketheman / example.rb
Created January 27, 2012 18:52
ruby - moved grep from string method to enumerable
ruby-1.8.7-p352 $ irb
1.8.7 :001 > thing = 'sometext'
=> "sometext"
1.8.7 :002 > thing.grep(/some/)
=> ["sometext"]
ruby-1.9.2-p290 $ irb
1.9.2p290 :001 > thing = 'sometext'
=> "sometext"
1.9.2p290 :002 > thing.grep(/some/)