Created
June 27, 2012 19:11
-
-
Save kellyredding/3006112 to your computer and use it in GitHub Desktop.
TIL: this form of Ruby string concatenation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I prefer subbing the
\
for+
. Same character length and it is clearer. At least to me anyway.