Hex to int conversion support

  • Thread starter Thread starter R Lee
  • Start date Start date
R

R Lee

Newbie trying to play around with forms creating a int to hex converter.
Does the framework have a conversion class? I can't believe that yet
another needs to be created.

Thanks for the feedback
Ron
 
R Lee said:
Newbie trying to play around with forms creating a int to hex converter.
Does the framework have a conversion class? I can't believe that yet
another needs to be created.

Just use the appropriate format specifier, x or X:

int i = 123;
string s = i.ToString("x");

s is now "7b"

See also Convert.ToString(int, int).
 
Back
Top