title: Trim() method in ruby?
body: <p>I have a string as the following.</p>
  
  <pre><code>\n
  \n
  line 1
  \n
  \n
  line 2
  \n
  \n
  line 3
  \n
  \n
  </code></pre>
  
  <p>I want to remove only start \n and end \n just llike php trim()</p>
  
  <p>I want result is</p>
  
  <pre><code>line 1
  \n
  \n
  line 2
  \n
  \n
  line 3
  </code></pre>
  
  <p>How do I do?</p>
  
  <pre><code>text.gsub(/^[\s]+|[\s]+$/, '')
  </code></pre>
  
  <p>will remove all \n</p>
  
  <pre><code>line 1
  line 2
  line 3
  </code></pre>