Convert.ToInt32 : Convert « System « C# / C Sharp by API






Convert.ToInt32

  


using System;
using System.Data;


class Class1{
        static void Main(string[] args){
      string base2 = "111";
      string base8 = "117";
      string base10 = "1110";
      string base16 = "11F1FF";

      Console.WriteLine("Convert.ToInt32(base2, 2) = " + 
        Convert.ToInt32(base2, 2));

      Console.WriteLine("Convert.ToInt32(base8, 8) = " + 
        Convert.ToInt32(base8, 8));

      Console.WriteLine("Convert.ToInt32(base10, 10) = " + 
        Convert.ToInt32(base10, 10));

      Console.WriteLine("Convert.ToInt32(base16, 16) = " + 
        Convert.ToInt32(base16, 16));
        }
}

   
    
  








Related examples in the same category

1.Convert.ChangeType
2.Convert.FromBase64CharArray
3.Convert.FromBase64String
4.Convert.ToBase64CharArray
5.Convert.ToBase64String
6.Convert.ToUInt32