Skip to content

Instantly share code, notes, and snippets.

@velppa
Created April 9, 2013 20:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velppa/5348988 to your computer and use it in GitHub Desktop.
Save velppa/5348988 to your computer and use it in GitHub Desktop.
Removes multiple commas in string
'asdf@gmail.com, , , qwer@gm.com, , '.split(',').map{|i| i.strip()}.find_all{|i| not i.empty?}.join(", ")
@pshapoval
Copy link

add

puts

for make it more obvious when run

@velppa
Copy link
Author

velppa commented Apr 12, 2013

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