Bitwise NOT (~) Expression Summary Perform a bitwise logical negation operation. Syntax ~ expression Parameters expression Any legal numeric expression. Description For numeric expressions, the ~ operator computes the value of the operand, converts it to its equivalent binary representation, performs a bitwise NOT operation on it, and returns the evaluated result. The bitwise NOT operation will invert each bit. Thus, a zero (0) bit will become one (1), and a one (1) bit will become zero (0). For example, here is an illustration of the evaluation of the expression ~5: 12300000000000000000000000000000101 (5)--------------------------------11111111111111111111111111111010 (-6) Differences from JavaScript Logical NOT operations are not limited to 32-bit integers in JS++. Unimplemented In JavaScript, the logical NOT operation is limited to signed 32-bit integers. Examples indexOf 1234567import System; string foobar = "foobar"; if (~foobar.indexOf("foo")) { Console.log("'foo' was found inside 'foobar'");} See Also Bitwise AND Operator Bitwise OR Operator Bitwise XOR Operator Share HTML | BBCode | Direct Link