title: Building multi-line strings, programmatically, in Ruby
body: <p>Here's something I often do when programming:</p>
  
  <pre><code>code = ''
  code &lt;&lt; "next line of code #{something}" &lt;&lt; "\n"
  code &lt;&lt; "another line #{some_included_expression}" &lt;&lt; "\n"
  </code></pre>
  
  <p><strong>Is there some better way than having <code>&lt;&lt; "\n"</code> or <code>+ "\n"</code> on every line?</strong> This seems quite inefficient.</p>
  
  <p>I'm interested in Ruby solutions, in particular. I'm thinking something like</p>
  
  <pre><code>code = string.multiline do
    "next line of code #{something}"
    "another line #{some_included_expression}"
  end
  </code></pre>