LANGUAGE
Bitwise XOR ^
Sets positions whose input bits differ. XOR with a mask toggles those positions.
Formal Syntax & Structure
csharp syntaxcsharp
flags ^ maskWorking Example
Example Snippetcsharp
int flags = 3 ^ 1; // 2Sets positions whose input bits differ. XOR with a mask toggles those positions.
flags ^ maskint flags = 3 ^ 1; // 2