title: Parsing a string to an Int32 in a console application
body: <p>I started programming just about 2 weeks ago and my friend said I could ask you guys for help if I need any.</p>
  
  <pre><code>    using System;
      using System.Collections.Generic;
      using System.Linq;
      using System.Text;
      using System.Threading.Tasks;
  
      namespace ConsoleApplication1
      {
          class Program
          {
              static void Main(string[] args)
              {
                  int x;
                  string s;
                  do
                  {
                      Console.WriteLine("input a number in the range of 0 -100");
                      s = Console.ReadLine();
                      x = s.ToInt32();
                  }
                  while (x &lt; 0 || x &gt; 100);
                  Console.WriteLine("ok you have chosen");
                  Console.ReadKey();
                  }
          }
      }
  </code></pre>
  
  <p>My first time running into that <code>x=s.ToInt32</code> (I've read that <code>int</code> is supposed to contain a number and not a <code>string</code> or letters..) and the error:</p>
  
  <pre><code>'string' does not contain a definition for 'ToInt32' and no extension method 'ToInt32' 
  accepting a first argument of type 'string' could be found (are you missing a using 
  directive or an assembly reference?)
  C:\Users\user\Documents\Visual Studio11\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs 19  23  ConsoleApplication1
  </code></pre>