title: Delete a empty line from a File
body: <p>I have a text file in which I add, update and delete data (<strong>Contacts</strong>). Each contact is in one line. Now when i delete a contact through my application, I am deleting a line in my file (<em>Replacing the contact with a empty string</em>) This is resulting a empty line in between contacts. I don't want this empty line. This is the piece of code that I wrote:</p>
  
  <pre><code>    private void btn_condel_Click(object sender, EventArgs e)
      {
          bufferedListView1.Items.Clear();
          string fileContents = File.ReadAllText("C:\\sample.txt");
          string replacedContents = fileContents.Replace(txt_editname.Text + "@" + txt_editno.Text,"");
          File.WriteAllText("C:\\sample.txt", replacedContents);
          // Rest of the code
  </code></pre>
  
  <p>What do I need to do to eliminate this empty line while replacing the data in the file.</p>