title: Char to Int explicit Conversion in C#
body: <p>I was trying to learn explicit conversion in c#. </p>
  
  <p>First I explicitly converted <code>string</code> to <code>int</code> </p>
  
  <pre><code>namespace MyfirstCSharpCode
  {
      class Program
      {
          static void Main(string[] args)
          {
              string str = "1234";
              int i = Convert.ToInt16(str);
              Console.WriteLine(i);
  
          }
      }
  }
  </code></pre>
  
  <p>it worked and the result is : <code>1234</code></p>
  
  <p>Now I tried to convert <code>char</code> to <code>int</code> </p>
  
  <pre><code>namespace MyfirstCSharpCode
  {
      class Program
      {
          static void Main(string[] args)
          {
              char str = '1';
              int i = Convert.ToInt16(str);
              Console.WriteLine(i);
  
          }
      }
  }
  </code></pre>
  
  <p>And now the result is <code>49</code>, the ASCII value of <code>1</code>. How to get the char <code>1</code> instead of ASCII value. Please don't be too harsh its my first day in c# ;).. </p>