Nullable Bool Not - CSharp System

CSharp examples for System:Nullable

Description

Nullable Bool Not

Demo Code



public class Main{
        internal static bool? Not(this bool? operand)
        {//  w ww.  j  a  v  a2s  .  c o  m
            // three-valued logic 'not' (T = true, F = false, U = unknown)
            //      !T = F
            //      !F = T
            //      !U = U
            return operand.HasValue ? !operand.Value : (bool?)null;
        }
}

Related Tutorials