There is a string
string a = "0x1234";
need to convert to
int a = 0x1234
Help me please.
You can use the Convert.ToInt32
method with the base of the number system:
int i = Convert.ToInt32(a, 16);
4660
, in hexadecimal - 0x1234
. - Dmitry D."X"
for it, for example: Console.WriteLine("{0:X}", i);
. MSDN - Dmitry D.Source: https://ru.stackoverflow.com/questions/566233/
All Articles