title: Multiple lines input from console in c#
body: <p>I am trying to read some values in c# from console and then processing them. However i am stuck at a error.</p>
  
  <p>The input from console is:</p>
  
  <pre><code>Name:ABCD
  School:Xyz
  Marks:80
   //here the user enters a new line before entering new data again
  Name:AB
  School:Xyz
  Marks:90
  //new line again 
  Name:AB
  School:Xyz
  Marks:90
  </code></pre>
  
  <p>and so on. I do not know before hand the number of console inputs...How can i detect that user has stopped entering &amp; store the input.</p>
  
  <p>I tried using </p>
  
  <pre><code>string line;
  while((line=Console.ReadLine())!=null)
  {
    //but here it seems to be an infinite loop 
  }
  </code></pre>
  
  <p>Any suggestions</p>