Skip to content

Instantly share code, notes, and snippets.

@philm
Created January 18, 2010 23:50
Show Gist options
  • Save philm/280507 to your computer and use it in GitHub Desktop.
Save philm/280507 to your computer and use it in GitHub Desktop.
city = 'San Francisco'
state = 'CA'
[city, state].compact * ', '
# => 'San Francisco, CA'
city = nil
state = 'CA'
[city, state].compact * ', '
# => 'CA'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment