C# StringBuilder StringBuilder(Int32, Int32)

Description

StringBuilder StringBuilder(Int32, Int32) Initializes a new instance of the StringBuilder class that starts with a specified capacity and can grow to a specified maximum.

Syntax

StringBuilder.StringBuilder(Int32, Int32) has the following syntax.


public StringBuilder(
  int capacity,
  int maxCapacity
)

Parameters

StringBuilder.StringBuilder(Int32, Int32) has the following parameters.

  • capacity - The suggested starting size of the StringBuilder.
  • maxCapacity - The maximum number of characters the current string can contain.

Example


using System;//from  w w  w.  jav a 2 s. com
using System.Text;

class Sample 
{
    public static void Main() 
    {
        int capacity = 255;
        int maxCapacity = 1024;
        StringBuilder stringBuilder = new StringBuilder(capacity, maxCapacity);
    }
}




















Home »
  C# Tutorial »
    System.Text »




ASCIIEncoding
Encoding
EncodingInfo
StringBuilder
UnicodeEncoding
UTF8Encoding