title: How to avoid while-loop code duplication?
body: <pre><code>string s = Console.ReadLine();
  while(s != null)
  {
      // do something 
      //   ....
      s = Console.ReadLine(); 
  }
  </code></pre>
  
  <p>The code above is to get the input, verify it, process it and then input again, but obviously, <code>s = Console.ReadLine();</code> is code duplication.</p>
  
  <p>What tricks are there to avoid the duplication?</p>