-3

Good day! How to print value with

Console.Writeline() 
  • int value as hex: For example: 1-> 0x000...01;

Thank you!

user2545071
  • 1,250
  • 2
  • 19
  • 43
  • This may help http://stackoverflow.com/questions/1139957/c-sharp-convert-integer-to-hex-and-back-again – David B Mar 19 '15 at 11:06
  • JGeerWM's answer in the linked duplicate answers your question. – Heinzi Mar 19 '15 at 11:07
  • @Heinzi [this question](http://stackoverflow.com/questions/642417/how-do-you-convert-hex-to-decimal-using-vb-net) is a much better duplicate than the one you provided, perhaps change it to that one? – AStopher Mar 19 '15 at 11:08

1 Answers1

1
int x = 1;
Console.WriteLine(x.ToString("X8"));

'8' stands for the number of digits you want to show with hex number.

Boluny
  • 84
  • 6