C# StringBuilder Append(Int16)

Description

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

Syntax

StringBuilder.Append(Int16) has the following syntax.


public StringBuilder Append(
  short value
)

Parameters

StringBuilder.Append(Int16) has the following parameters.

  • value - The value to append.

Returns

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

Example

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


/*from   www .ja v  a 2s  .c o  m*/
using System;
using System.Text;

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

    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Text »




ASCIIEncoding
Encoding
EncodingInfo
StringBuilder
UnicodeEncoding
UTF8Encoding