compare string from a list of strings
<p>i'm reading a file with 10002 lines, in each line there is a name that I want to compare with a single string, and if this string is the same, i want to add the string file to a listbox, I'm using the FILE.READLINE and then add each line to a list then I use .CONTAINS method and doesnt works also with == but that doesn work either...Any suggestions?</p>

<pre><code>//This is my code:

foreach (string h in Directory.EnumerateFiles(NomDirec, "resume*"))
{
  this.listBox1.Items.Add(h);
  //Read Lines here and add them to a list and a listbox 
  var NombreLinea = File.ReadLines(h);
  foreach (var item in NombreLinea)
  {
    NombreAbuscar.Add(item).Remove(item.IndexOf(":"));
    this.listBox3.Items.Add(item);
  }

  //Here I want to add this file only if "NombreCompleto" is present in my resume file.
  foreach (string t in Directory.EnumerateFiles(NomDirec, "ESSD1*"))
  {
    string[] Nombre = File.ReadLines(t).ElementAtOrDefault(6).Split(':');
    string[] ApellidoPat = File.ReadLines(t).ElementAtOrDefault(7).Split(':');
    string[] ApellidoMat = File.ReadLines(t).ElementAtOrDefault(8).Split(':');
    string NombreCompleto = ApellidoPat[1] + ApellidoMat[1] + "," + " " + Nombre[1] + " " + ":";
    foreach (var item in NombreAbuscar)
    {
      if (NombreCompleto == item)
      {
        this.listBox1.Items.Add(t);
        break;
      }
    }
  }
</code></pre>

<p>Could be a way to only read the a certain part of the line and add it to my listbox??</p>
