Numeric Formatting:Standard Format Strings:Hexadecimal
using System; public class Hexadecimal { public static void Main() { Console.WriteLine("{0:X}", 255); Console.WriteLine("{0:x8}", 1456); } }