Skip to content

Instantly share code, notes, and snippets.

@velppa
Created April 9, 2013 20:14
Show Gist options
  • Select an option

  • Save velppa/5348988 to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown

add

puts

for make it more obvious when run

@velppa

velppa commented Apr 12, 2013

Copy link
Copy Markdown
Author

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