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)

Syntax

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

Parameters

  • 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.

Exceptions

Exception Condition
ArgumentOutOfRangeException

startIndex or length is less than zero.

-or-

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

Platforms

Windows Phone

See Also

Reference

StringBuilder Class

ToString Overload

System.Text Namespace