C# StringBuilder Append(Byte)

Description

StringBuilder Append(Byte) Appends the string representation of a specified 8-bit unsigned integer to this instance.

Syntax

StringBuilder.Append(Byte) has the following syntax.


public StringBuilder Append(
  byte value
)

Parameters

StringBuilder.Append(Byte) has the following parameters.

  • value - The value to append.

Returns

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

Example

Appends the string representation of a specified 8-bit unsigned integer to this instance.


using System;/*  ww w . j  a va 2s .c  o  m*/
using System.Text;

class Sample 
{
    public static void Main() 
    {
        Byte[] bytes = { 16, 132, 27, 253 };
        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        foreach (var value in bytes)
           sb.Append(value).Append(" ");         
        
        Console.WriteLine("The byte array: {0}", sb.ToString());

    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Text »




ASCIIEncoding
Encoding
EncodingInfo
StringBuilder
UnicodeEncoding
UTF8Encoding