Possible Duplicate:
How to convert an integer to fixed length hex string in C#?
I need to format a range of UInt32 values to a fixed length hexadecimal representation. Formatting in hex is the easy part, but the resulting strings are between 6 and 8 characters wide. How do I format the string to always be 8 characters wide?
Here is an example of what I am doing currently:
string valueA = Convert.ToString(UInt32.MaxValue, 16); // result is "ffffffff"
string valueB = Convert.ToString(UInt32.MinValue, 16); // result is "0", i want "00000000"