C# StringBuilder StringBuilder(Int32)

Description

StringBuilder StringBuilder(Int32) Initializes a new instance of the StringBuilder class using the specified capacity.

Syntax

StringBuilder.StringBuilder(Int32) has the following syntax.


public StringBuilder(
  int capacity
)

Parameters

StringBuilder.StringBuilder(Int32) has the following parameters.

  • capacity - The suggested starting size of this instance.

Example


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

class Sample 
{
    public static void Main() 
    {
        StringBuilder sb1 = new StringBuilder(123);
        Console.WriteLine(sb1.Capacity);
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Text »




ASCIIEncoding
Encoding
EncodingInfo
StringBuilder
UnicodeEncoding
UTF8Encoding