title: C# - Use ReadKey for loop
body: <p>I have been searching the web for about an hour and I just can't find the answer to my question. I'm very new to programming and I hope I'm not wasting your time. I want my program to loop if I would click "Y", exit if I click "N" and do nothing if I click any other button. Cheers!</p>
  
  <pre><code>Console.Write("Do you wan't to search again? (Y/N)?");
  if (Console.ReadKey() = "y")
  {
      Console.Clear();
  }
  else if (Console.ReadKey() = "n")
  {
      break;
  } 
  </code></pre>