C# StringBuilder Append(Int32)

Description

StringBuilder Append(Int32) Appends the string representation of a specified 32-bit signed integer to this instance.

Syntax

StringBuilder.Append(Int32) has the following syntax.


public StringBuilder Append(
  int value
)

Parameters

StringBuilder.Append(Int32) has the following parameters.

  • value - The value to append.

Returns

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

Example

Appends the string representation of a specified 32-bit signed integer to this instance.


/*from   ww w.j  a  va  2s .  c om*/
using System;
using System.Text;

class Sample 
{
    public static void Main() 
    {
        System.Text.StringBuilder sb = new 
               System.Text.StringBuilder("The range of a 32-bit integer: ");
        sb.Append(Int32.MinValue).Append(" to ").Append(Int32.MaxValue);
        Console.WriteLine(sb);

    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Text »




ASCIIEncoding
Encoding
EncodingInfo
StringBuilder
UnicodeEncoding
UTF8Encoding