This documentation is archived and is not being maintained.

true Literal (C# Reference)

Represents the boolean value true.

class TrueTest
{
    static void Main() 
    {
        bool a = true;
        Console.WriteLine( a ? "yes" : "no" );
    }
}
/*
Output:
yes
*/

For more information, see the following sections in the C# Language Specification:

  • 2.4.4.1 Boolean literals

Show: