C# StringBuilder Append(Char[]) Array

Description

StringBuilder Append(Char[]) Appends the string representation of the Unicode characters in a specified array to this instance.

Syntax

StringBuilder.Append(Char[]) has the following syntax.


public StringBuilder Append(
  char[] value
)

Parameters

StringBuilder.Append(Char[]) has the following parameters.

  • value - The array of characters to append.

Returns

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

Example

Appends the string representation of the Unicode characters in a specified array to this instance.


using System;// w w  w  . jav a  2s . c  o  m
using System.Text;

class Sample 
{
    public static void Main() 
    {
        char[] chars = { 'a', 'e', 'i', 'o', 'u' };
        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        sb.Append("The characters in the array: ").Append(chars);
        Console.WriteLine(sb);

    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Text »




ASCIIEncoding
Encoding
EncodingInfo
StringBuilder
UnicodeEncoding
UTF8Encoding