Export (0) Print
Expand All

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
[C#]
public string ToString(
 int startIndex,
 int length
);
[C++]
public: String* ToString(
 int startIndex,
 int length
);
[JScript]
public function ToString(
   startIndex : int,
 length : int
) : String;

Parameters

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

Return Value

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

Exceptions

Exception Type 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.

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

See Also

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

Show:
© 2014 Microsoft