本文介绍了在vb.net中进行异或的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
能否请您帮助我在vb.net中进行异化
我想对这些值进行异或运算
Hey all
can you please help me in xoring in vb.net
i wanna xor these values
8f xor 33 xor cc xor 6a =1a
43 xor 19 xor 57 xor 39 =34
ae xor c6 xor 40 xor 2d =05
1a xor 49 xor 8b xor 6b =b3
在此先感谢
Thanks in advance
推荐答案
dim x as integer = (((8f xor 33) xor cc) xor 6a)
如果值的数量是可变的,则可以编写一个方法:
If the number of values is variable, you could write a method:
public Function XOrStack(values as integer()) as integer
Dim result as integer = 0
if (values.Length > 0) then
foreach (value as integer in values)
result = result Xor value
Next
end if
return result
End Function
我是C#,所以上面的代码可能需要调整.
I''m a C# guy, so the code above may need tweaking.
这篇关于在vb.net中进行异或的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!