Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Convert Hex String to Hex Number [duplicate]

Tags:

c#

hex

Possible Duplicate:
How do I convert hex string into signed integer?

example:"3A" convert to 0x3A,thanks a lot!

like image 712
rooney Avatar asked Nov 25 '10 09:11

rooney


People also ask

How do you convert hexadecimal to double?

X = hex2num( hexStr ) converts hexStr to the double-precision floating-point number that it represents. The input argument hexStr has up to 16 characters representing a number in its IEEE® format using hexadecimal digits.

What is a Hexstring?

Hexadecimal Number String. The “Hexadecimal” or simply “Hex” numbering system uses the Base of 16 system and are a popular choice for representing long binary values because their format is quite compact and much easier to understand compared to the long binary strings of 1's and 0's.

How do you write hex numbers in C#?

To represent Int32 as a Hexadecimal string in C#, use the ToString() method and set the base as the ToString() method's second parameter i.e. 16 for Hexadecimal. Int32 represents a 32-bit signed integer.


1 Answers

Convert.ToInt32("3A", 16) 
like image 150
crdx Avatar answered Oct 02 '22 16:10

crdx