This documentation is archived and is not being maintained.

StringBuilder Constructor (Int32, Int32)

.NET Framework 1.1

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

[Visual Basic]
Public Sub New( _
   ByVal capacity As Integer, _
   ByVal maxCapacity As Integer _
)
[C#]
public StringBuilder(
   int capacity,
 int maxCapacity
);
[C++]
public: StringBuilder(
   int capacity,
 int maxCapacity
);
[JScript]
public function StringBuilder(
   capacity : int,
 maxCapacity : int
);

Parameters

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

Exceptions

Exception Type Condition
ArgumentOutOfRangeException maxCapacity is less than one, capacity is less than zero, or capacity is greater than maxCapacity.

Remarks

If capacity is zero, the implementation-specific default capacity is used.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

StringBuilder Class | StringBuilder Members | System.Text Namespace | StringBuilder Constructor Overload List

Show: