Converting a string with a hexadecimal representation of a number to an actual numeric value

前端 未结 6 926
渐次进展
渐次进展 2020-12-21 10:49

I have a string like this:

\"00c4\"

And I need to convert it to the numeric value that would be expressed by the literal:

0         


        
6条回答
  •  盖世英雄少女心
    2020-12-21 11:00

    There is no such thing as an 'actual hex value'. Once you get into the native datatypes you are in binary. Getting there from a hex string is covered above. Showing it as output in hex, ditto. But it isn't an 'actual hex value'. It's just binary.

提交回复
热议问题