C# StringBuilder Append(Decimal)

Description

StringBuilder Append(Decimal) Appends the string representation of a specified decimal number to this instance.

Syntax

StringBuilder.Append(Decimal) has the following syntax.


public StringBuilder Append(
  decimal value
)

Parameters

StringBuilder.Append(Decimal) has the following parameters.

  • value - The value to append.

Returns

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

Example

Appends the string representation of a specified decimal number to this instance.


//from   ww w .ja  v  a  2s  .  c  o m


using System;
using System.Text;

class Sample 
{
    public static void Main() 
    {
        decimal value = 1346.19m;
        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        sb.Append('*', 5).Append(value).Append('*', 5);
        Console.WriteLine(sb);

    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Text »




ASCIIEncoding
Encoding
EncodingInfo
StringBuilder
UnicodeEncoding
UTF8Encoding