StringBuilder.ToString Method

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

Converts the value of this instance to a String.

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

Syntax

Public Overrides Function ToString As String
public override string ToString()

Return Value

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

Examples

The following code example demonstrates calling the ToString method. This code example is part of a larger example provided for the StringBuilder class.

' Display the number of characters in the StringBuilder and its string.
outputBlock.Text += String.Format("{0} chars: {1}", sb.Length, sb.ToString()) & vbCrLf
// Display the number of characters in the StringBuilder and its string.
outputBlock.Text += String.Format("{0} chars: {1}", sb.Length, sb.ToString()) + "\n";

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