使用VB.NET逆转非复制

时间:2012-08-29 14:32:21

标签: .net vb.net boolean-logic

如何使用VB.NET(两个整数之间)进行converse nonimplication

我有两个标记枚举myFlag1myFlag2,并希望获得myFlag3只包含myFlag2myFlag1中不存在的值。<登记/> 我知道XOR运营商,但这并不好。

The Venn Diagram of "It is not the case that B implies A" (the red area is true)

说我有

010110
100011
------
100001 (this is what I need)

另外

111
101
---
000

1 个答案:

答案 0 :(得分:5)

Dim a As Integer = 22
Dim b As Integer = 35

Dim output As Integer = (b And Not a)

当试图向某人解释时,几乎就是你大声说出来的。 :)