Format integer as hexadecimal
using System;
using System.Globalization;
public class Example
{
public static void Main()
{
int[] numbers = { -111, 0, 169, 11111 };
foreach (int number in numbers) {
// Display value as hexadecimal.
Console.Write("{0,12:X2}", number);
}
}
}
// FFFFFF91 00 A9 2B67
Related examples in the same category