Search code examples
vb.netbit-manipulationxor

Bitwise XOR in VB.NET


I'm trying to get an application to XOR two hexadecimal values and output the result as a decimal value.

I have searched the Internet for an answer, but every result simply gives a true or false result.

The figures I am using as an example are

Value 1 = 0F8F
Value 2 = FB8E
expect result = 62465

What should I do?


Solution

  • You need to use the &H hexadecimal literal:

    result = (&HF8F Xor &HFB8E)
    

    62465