Welcome to MSDN Blogs Sign in | Join | Help

XOR in C#

Random factoid:

Use  ^  for bitwise XOR in C#, for example:

  a = a ^ c;   (or simply:   a ^= c;)

 

Published Thursday, October 27, 2005 11:27 AM by Addys

Comments

# re: XOR in C#

Sunday, December 11, 2005 4:02 PM by C.K. "B.C."
Thank you!!
I needed to code a method that used xor in C# and I didn't know how, I didn't have any resource besides google that could tell me, and when I googled, I did not have any luck, for maby ten minutes of searching >:( but then I found this. probelm solved. Thanks!!

solution completed, an exerpt of my code:

static bool toggle(bool input)
{
return input ^ true;
}
New Comments to this post are disabled
 
Page view tracker