-1

I've found a few articles on StackOverflow about this question, but they are all either slightly different or don't work for whatever reason. So my question to you is this: How do I convert a int into a hex string. Thanks

Edit: I've stuffed up, stupid mistake. Basically my brain melted and didnt realise that 0x0054 is 80 in decimal. :P Sorry...

Lachlan Mather
  • 135
  • 2
  • 5
  • 14

2 Answers2

1
string hexa = into_variable.ToString("X")

Easy solution

jobinrjohnson
  • 568
  • 5
  • 13
0
int myInt = 1992;
string myHex = myInt.ToString("X"); 
GorvGoyl
  • 42,508
  • 29
  • 229
  • 225