What is the equivalent of the |= operator in Visual Basic? For example (C#):
flags |= MyEnum.SomeFlag
The &= operator concatenates the String expression on its right to the String variable or property on its left, and assigns the result to the variable or property on its left.
+ is an arithmetic operator while += is an assignment operator.. When += is used, the value on the RHS will be added to the variable on the LHS and the resultant value will be assigned as the new value of the LHS..
flags = flags Or MyEnum.SomeFlag
In C#, |= is the Or assignment operator.
There's no equivalent operator in VB.
See the list of Assignment Operators (Visual Basic).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With