Reputation: 3
I got a string with Hex words, STR = "48 3D E3 F4"
, (the spaces between the words don't matter). I want to make it first like that I = 483DE3F4
but we can't put D
,E
,F
in int32
.
How can I make it, so that I = 1212015604
?
Upvotes: 0
Views: 502
Reputation: 14487
Use int.Parse(string, NumberStyles)
to parse hexadecimal :
int.Parse("48 3D E3 F4".Replace(" ", string.Empty), System.Globalization.NumberStyles.HexNumber)
Upvotes: 1