Operators: !

Logical NOT operator.

Syntax

!bool‑operand

Unary logical negation

The operator results in a logical negation of a boolean operand: false if the operand was true and true if the operand was false. For example:

var bool a = true;

var bool result = !a; // result = false