This documentation is archived and is not being maintained.
&= Operator (C# Reference)
The AND assignment operator.
An expression using the &= assignment operator, such as
is equivalent to
except that x is only evaluated once. The & operator performs a bitwise logical AND operation on integral operands and logical AND on bool operands.
The &= operator cannot be overloaded directly, but user-defined types can overload the binary & operator (see operator).
static void Main()
int a = 0x0c;
a &= 0x06;
bool b = true;
b &= false;