title: How to remove specific lines of a file in vb.net
body: <p>I've got a file with a list of the names:</p>
  
  <blockquote>
    <p>Bill<br>
    Jack<br>
    Sam<br>
    Sarah  </p>
  </blockquote>
  
  <p>I want to be able to remove specific lines so if I asked it to remove "Jack" then the new list would become:</p>
  
  <blockquote>
    <p>Bill<br>
    Sam<br>
    Sarah</p>
  </blockquote>
  
  <p>What I've got so far:</p>
  
  <pre><code>Imports System.IO
  Dim filename As String = "C:\names.txt"
  Dim StreamReader As New StreamReader(filename)
  Dim LineCount As Integer = File.ReadAllLines(filename).Length
  
  For i = 0 to LineCount - 1
      If StreamReader.ReadLine() = "Jack" Then
          'Remove This Line
      End If
  Next
  </code></pre>