Created
April 9, 2013 20:14
-
-
Save velppa/5348988 to your computer and use it in GitHub Desktop.
Removes multiple commas in string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'[email protected], , , [email protected], , '.split(',').map{|i| i.strip()}.find_all{|i| not i.empty?}.join(", ") |
What for? String became string and do what you want with it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
add
puts
for make it more obvious when run