Skip to content

Instantly share code, notes, and snippets.

@hughevans
Created March 16, 2012 05:39
Show Gist options
  • Save hughevans/2048694 to your computer and use it in GitHub Desktop.
Save hughevans/2048694 to your computer and use it in GitHub Desktop.
Reject blank/empty strings before joining with a space.
[' ', 'Evans'].reject(&:blank?).join ' '
@amasses
Copy link

amasses commented Mar 16, 2012

While this is helpful, it does add a bit more time to execution.. :) over 1M records that is... (https://gist.github.com/2048697)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment