Skip to content

Instantly share code, notes, and snippets.

@kellyredding
Created June 27, 2012 19:11
Show Gist options
  • Save kellyredding/3006112 to your computer and use it in GitHub Desktop.
Save kellyredding/3006112 to your computer and use it in GitHub Desktop.
TIL: this form of Ruby string concatenation
puts 'hello ''there'
# => 'hello there'
puts "Wow! "\
"This is a better way to get long "\
"strings into your code without "\
"violating your style guide that "\
"recommends no line be longer than "\
"80 characters long."
# => "Wow! This is a better way to get long strings into your code without violating your style guide that recommends no line be longer than 80 characters long."
@tpett
Copy link

tpett commented Jun 28, 2012

I prefer subbing the \ for +. Same character length and it is clearer. At least to me anyway.

@kellyredding
Copy link
Author

@tpett - hey, someone actually looks at these! Thanks man.

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