title: Removing dangling CR in a file using C#
body: <p>I have a scenario where in I have a dangling <strong>CR</strong>(Carriage Return) in my file. But each line is delimited by <strong>CRLF</strong>. </p>
  
  <p>For example I have a following line in the file say input.txt:</p>
  
  <blockquote>
    <p>Stackoverflow is a lovely site to use <strong>CR</strong> for any novice user
    <strong>CRLF</strong></p>
  </blockquote>
  
  <p>If I use the method ReadAllLines in my code. I get 2 distinct strings.</p>
  
  <pre><code>string[] lines = File.ReadAllLines(input.txt)
  
  lines[0] = "Stackoverflow is a lovely site to use "
  
  lines[1] = "for any novice user "
  </code></pre>
  
  <p>Now I have to eliminate only the <strong>CR</strong> in the above line and preserve the <strong>CRLF</strong></p>
  
  <p>So that I can get;</p>
  
  <pre><code>lines[0] = "Stackoverflow is a lovely site to use for any novice user "
  </code></pre>
  
  <p>How can I do this in C#?</p>