title: Using Streamreader in C# merge multiple lines into a single line
body: <p>I have searched SO but did not find anything that specifically addresses this issue: So here goes -
  I have a text file where the paragraphs have lines of text ending with a "return". So it ends up on separate lines - I would like to merge these multiple lines into a single line.
  I am using Streamreader in C# ( VS 2010).</p>
  
  <blockquote>
    <p>Example:</p>
    
    <p>GE1:1</p>
    
    <p>xxxxxxxxxxxxxxxxxxxxx</p>
    
    <p>yyyyyyyyyyyyyy.</p>
    
    <p>hhhhhhhhhhhhh.</p>
    
    <p>GE1:2</p>
    
    <p>zzzzzzzzzzz</p>
    
    <p>kkkkkkkkkkkkkkkkkkkkkkk</p>
    
    <p>and so on....</p>
  </blockquote>
  
  <p>As you can see in above example some paragraphs have 3 lines and some have two.It varies.
  There are thousands of these paras in the text file.</p>
  
  <p>Basically I would like to have my variable "templine" contain the following: (which will be used for further processing). </p>
  
  <pre><code>var templine = "xxxxxxxxxxxxxxxxxxxxx yyyyyyyyyyyyyy. hhhhhhhhhhhhh."
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>     using (StreamReader sr = new StreamReader(@"C:\Test.txt"))
          using(StreamWriter sw = new StreamWriter(@"C:\Test2.txt"))
          {
              StringBuilder sb    = new StringBuilder ( );
  
  
              while (!sr.EndOfStream)
              {
                      string templine = sr.ReadLine();  /// further processing code not relevant.
  </code></pre>
  
  <p>UPDATE:
  What i need is a way to detect if a paragraph has 3 lines or two.
  I  know how to remove the Newline character etc.. just cant work out how to know when the paragraph ends.</p>