I have string like 10000005 (and it is hex) and i want to make uint hex value like: 0x10000005
How can i do this?
Example:
string hexStr="10000005"
uint hex= //??? (0x10000005);
P.S. I need that hex should be : 0x10000005
I have string like 10000005 (and it is hex) and i want to make uint hex value like: 0x10000005
How can i do this?
Example:
string hexStr="10000005"
uint hex= //??? (0x10000005);
P.S. I need that hex should be : 0x10000005
You can use the the standard Convert
class which exposes ToUInt32
method for this.
string hexString = "10000005";
uint hex = Convert.ToUInt32(hexString, 16);
hex.ToString("X") // Output: 10000005