Numeric Formatting : Hexadecimal : Data Type C# Examples


C# Examples » Data Type » Hexadecimal »

 

Numeric Formatting





A hexadecimal literal must begin with 0x (a zero followed by an x).




    
using  System;

class  MainClass
{
        public  static  void  Main()
        {
                Console.WriteLine("{0:X}",  255);
                Console.WriteLine("{0:x8}",  1456);
        }
}
    
   
  
   



Output

FF
000005b0


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Hexadecimal