IndexOf does not correctly identify if a line starts with a value
<p>How can I remove a whole line from a text file if the first word matches to a variable I have?</p>

<p>What I currently have is:</p>

<pre><code>List&lt;string&gt; lineList = File.ReadAllLines(dir + "textFile.txt").ToList();
lineList = lineList.Where(x =&gt; x.IndexOf(user) &lt;= 0).ToList();
File.WriteAllLines(dir + "textFile.txt", lineList.ToArray());
</code></pre>

<p>But I can't get it to remove.</p>
