ToString Method (Int32, Int32)
Collapse the table of content
Expand the table of content

StringBuilder.ToString Method (Int32, Int32)

.NET Framework 1.1

Converts a substring of the current StringBuilder to a String.

[Visual Basic]
Overloads Public Function ToString( _
   ByVal startIndex As Integer, _
   ByVal length As Integer _
) As String
public string ToString(
 int startIndex,
 int length
public: String* ToString(
 int startIndex,
 int length
public function ToString(
   startIndex : int,
 length : int
) : String;


The starting position of the substring.
The length of the substring.

Return Value

A string whose value is the same as the specified substring of the value of this instance.


Exception Type Condition
ArgumentOutOfRangeException startIndex or length is less than zero.


The sum of startIndex and length is greater than the length of the current instance.


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, Common Language Infrastructure (CLI) Standard

See Also

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

© 2016 Microsoft