C# StringBuilder Append(Boolean)

Description

StringBuilder Append(Boolean) Appends the string representation of a specified Boolean value to this instance.

Syntax

StringBuilder.Append(Boolean) has the following syntax.


public StringBuilder Append(
  bool value
)

Parameters

StringBuilder.Append(Boolean) has the following parameters.

  • value - The Boolean value to append.

Returns

StringBuilder.Append(Boolean) method returns A reference to this instance after the append operation has completed.

Example

Appends the string representation of a specified Boolean value to this instance.


using System;/* ww  w .j  a  va2 s. c om*/
using System.Text;

class Sample 
{
    public static void Main() 
    {
        bool flag = false;
        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        sb.Append("flag:").Append(flag).Append(".");
        Console.WriteLine(sb.ToString());
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Text »




ASCIIEncoding
Encoding
EncodingInfo
StringBuilder
UnicodeEncoding
UTF8Encoding