title: Deleting a line in a text file
body: <p>Ok, I tried to delete lines that contain -- from a file. The file looks like this:</p>
  
  <pre><code>  -----------------------------------------------------------------
    Lorem ipsum....
    Text.....
  </code></pre>
  
  <p>And my code:</p>
  
  <pre><code>  f = File.open('C:\websites\ahr.txt')
    f.each_line do |line|
      if line.include? '-'
       a = line
       line.delete a
      end
    end
  f = File.close
  </code></pre>
  
  <p>But it won't work! I get this error:</p>
  
  <pre><code> file.rb:5:in `delete': invalid range "-- (ArgumentError)
   " in string transliteration
      from file.rb:5:in `block in &lt;main&gt;'
      from file.rb:2:in `each_line'
      from file.rb:2:in `&lt;main&gt;'
  </code></pre>
  
  <p>What's going on?</p>