This documentation is archived and is not being maintained.

StringBuilder Constructor (String, Int32, Int32, Int32)

.NET Framework 1.1

Initializes a new instance of the StringBuilder class from the specified substring and capacity.

[Visual Basic]
Public Sub New( _
   ByVal value As String, _
   ByVal startIndex As Integer, _
   ByVal length As Integer, _
   ByVal capacity As Integer _
public StringBuilder(
   string value,
 int startIndex,
 int length,
 int capacity
public: StringBuilder(
   String* value,
 int startIndex,
 int length,
 int capacity
public function StringBuilder(
   value : String,
 startIndex : int,
 length : int,
 capacity : int


The string that contains the substring used to initialize the value of the instance. If value is a null reference (Nothing in Visual Basic), the new StringBuilder will contain the empty string (that is, it contains Empty).
The position where the substring begins.
The number of characters in the substring.
The suggested starting size of the StringBuilder.


Exception Type Condition
ArgumentOutOfRangeException capacity is less than zero.


startIndex plus length is not a position within value.


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


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