title: Remove a specific line in text file with c#
body: <p>I'm building an app for windows 8 desktop, I'm reading in a text file and I want to change one specific line but not sure how so what I have is a text file that says</p>
  
  <pre><code>username|false
  username|false
  username|false
  </code></pre>
  
  <p>And I want to remove the middle line when something happens, this is what I have so far;</p>
  
  <pre><code>StorageFolder folder = ApplicationData.Current.LocalFolder;
  StorageFile storageFile = await folder.GetFileAsync("students.txt");
  var text = await Windows.Storage.FileIO.ReadLinesAsync(storageFile);
  var list_false = "";
  
  foreach (var line in text)
  {
      string name = "" + line.Split('|')[0];
      string testTaken = "" + line.Split('|')[1];
      if (your_name.Text == name)
      {
          if (testTaken == "false") {
              pageTitle.Text = name;
              enter_name_grid.Opacity = 0;
              questions_grid.Opacity = 1;
              var md = new MessageDialog("Enjoy the test");
              await md.ShowAsync();
          }
          else
          {
              the_name.Text = "You have already taken the test";
              var md1 = new MessageDialog("You have already taken the test");
              await md1.ShowAsync();
          }
          return;
      }
      else
      {
          list_false = "You're not on the list";
      }
  }
  if (list_false == "You're not on the list") {
      var md2 = new MessageDialog("You're not on the list");
      await md2.ShowAsync();
  }
  </code></pre>
  
  <p>Help please, it reads in names perfectly and allows them to take the test, I just need it to remove the correct line. Thanks in advance!!</p>