-2

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

Admiral Land
  • 2,304
  • 7
  • 43
  • 81

1 Answers1

1

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
Riddell
  • 1,429
  • 11
  • 22