I've got a simple question i have got a long value presented in this way
long value = 0x001f0347
Now is there's a way to convert it to string that looks the same:
string value = "0x001f0347";
I have tried some converters but no luck.
I've got a simple question i have got a long value presented in this way
long value = 0x001f0347
Now is there's a way to convert it to string that looks the same:
string value = "0x001f0347";
I have tried some converters but no luck.
Try formatting ("x8"
format string - 8 hexadecimal digits):
long value = 0x001f0347;
string result = "0x" + value.ToString("x8");
If you prefer Convert
then convert using toBase == 16
and pad left up to 8
symbols
string result = "0x" + Convert.ToString(value, 16).PadLeft(8, '0');