September 2017
Beginner
402 pages
9h 52m
English
These operators are the logical operators over strings. They start with the ~ character to follow the general idea that string operations use a tilde. The ~&, ~|, and ~^ operators do the AND, OR, and XOR operations respectively.
Before the bitwise operation, both operands are converted into the string representation (if necessary). Then, the operation is executed over the corresponding bits.
Let's consider an example of how to make the ASCII alphabetic character lowercase. In ASCII, the difference between the code of the lowercase and uppercase letter is 32 (0x20 in hexadecimal notation). So, to make the letter lowercase, execute a ~| operation on it and 0x20, which is the code of space, to set the fifth bit to