SHARE
TWEET

Untitled

a guest Apr 9th, 2013 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. irb(main):001:0> ['foo', 'foo bar', 'foo 007', 'foo007', '007'].map { |s| s.tr('^A-Za-z0-9', '') }
  2. => ["foo", "foobar", "foo007", "foo007", "007"]
  3.  
  4. irb(main):002:0> ['foo', 'foo bar', 'foo 007', 'foo007', '007'].map { |s| s.tr!('^A-Za-z0-9', '') }
  5. => [nil, "foobar", "foo007", nil, nil]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top