title: Checking if user input is an integer in c#
body: <p>So I'm making a little text game, and I need the user to enter an integer when it asks for grid size. And if an integer isn't entered I want the question to be asked again.</p>
  
  <p>Right now I have:</p>
  
  <pre><code>Console.WriteLine("Enter Grid Size.");
  int gridSize = int.Parse(Console.ReadLine());
  </code></pre>
  
  <p>I need a way to check if the input is a integer, and then ask again if it's not. Thanks</p>