title: Eliminating nil lines
body: <p>I have the following code:</p>
  
  <pre><code>f = File.open("/log/mytext.txt")
  f.each_line do |i|
  i = i.delete("\n")
  puts i.inspect
  </code></pre>
  
  <p>The delete gets rid of the \n, but the result looks like this:</p>
  
  <pre><code>"#&lt;MatchData \"line1\"&gt;"
  ""
  ""
  ""
  "#&lt;MatchData \"line2\"&gt;"
  </code></pre>
  
  <p>Want it to return :</p>
  
  <pre><code>line1
  line2
  </code></pre>
  
  <p>Been fighting this problem all day. Thanks for your help</p>