Convert bool value to string in CSharp

Description

The following code shows how to convert bool value to string.

Example


using System;//w ww .  java 2 s.co  m
using System.Collections.Generic;
using System.Text;

class Program {
    static void Main(string[] args) {
        bool b3 = true;    // No problem.
        bool b4 = false;   // No problem.
        Console.WriteLine("-> bool.FalseString: {0}", bool.FalseString);
        Console.WriteLine("-> bool.TrueString: {0}", bool.TrueString);
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    Data Types »




C# Data Types
Bool
Byte
Char
Decimal
Double
Float
Integer
Long
Short
String
C# Array
Array Example
Byte Array
C# Standard Data Type Format
BigInteger
Complex
Currency
DateTime
DateTimeOffset
DateTime Format Parse Convert
TimeSpan
TimeZone
Enum
Null
tuple
var