How do I convert the following string:
6F
for example, to a normal int? It's hexdecimal value.
Thanks.
string s = "6F";
int i = Int32.Parse(s, NumberStyles.AllowHexSpecifier);
Console.WriteLine(i); // prints "111" to the console
For details on NumberStyles
, see MSDN.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With