NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

! Operator

The logical negation operator (!) is a unary operator that negates its operand. It is defined for bool and returns true if and only if its operand is false.

User-defined types can overload the ! operator (see operator).

Example

using System;
class Test {
   public static void Main() {
      Console.WriteLine(!true);
      Console.WriteLine(!false);
   }
}

Output

False
True

See Also

C# Operators | CLR 7.6.3 Logical negation operator