StringBuilder.ToString Method (Int32, Int32)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Converts the value of a substring of this instance to a String.

Namespace: System.Text
Assembly: mscorlib (in mscorlib.dll)


Public Function ToString ( _
    startIndex As Integer, _
    length As Integer _
) As String
public string ToString(
    int startIndex,
    int length


  • startIndex
    Type: System..::.Int32
    The starting position of the substring in this instance.

Return Value

Type: System..::.String
A string whose value is the same as the specified substring of this instance.


Exception Condition

startIndex or length is less than zero.


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

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0


Windows Phone

See Also


StringBuilder Class

ToString Overload

System.Text Namespace