Created
May 17, 2012 16:55
-
-
Save evanphx/2720171 to your computer and use it in GitHub Desktop.
This file contains 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
hash = "abcdefg" | |
s = <<abcdefg.chomp | |
blah | |
abcdefg | |
p s |
oh right. You're probably embedding it directly in an expression. Heredocs are a pain because of that, they can't be in the middle of an expression.
Okay, so that fundamentally won't work them. Hrm. Just pick a separator and then gsub it, you think?
Yep. I'd go with `. It's easy to see, gsub, and is rare.
I had to go with ; because the `s were getting eval'd.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right. But I don't need to save it off to a variable... the string just needs to be in there. that's why the old code was just
"#{str}";