CSharp examples for Language Basics:Operator
The logical NOT operator (~) is used to flip the bits of a value.
The NOT operator is unary-it works with only one value.
The results are as follows:
Using this on an unsigned byte that contains the value of 1 (00000001) would result in the number 254 (11111110).