Redigera

Dela via


StringWriter.GetStringBuilder Method

Definition

Returns the underlying StringBuilder.

public:
 virtual System::Text::StringBuilder ^ GetStringBuilder();
public virtual System.Text.StringBuilder GetStringBuilder ();
abstract member GetStringBuilder : unit -> System.Text.StringBuilder
override this.GetStringBuilder : unit -> System.Text.StringBuilder
Public Overridable Function GetStringBuilder () As StringBuilder

Returns

The underlying StringBuilder.

Examples

This code example is part of a larger example provided for the StringWriter() constructor.

// Use the underlying StringBuilder for more complex 
// manipulations of the string.
strWriter->GetStringBuilder()->Insert( 0, "Invalid " );
// Use the underlying StringBuilder for more complex
// manipulations of the string.
strWriter.GetStringBuilder().Insert(0, "Invalid ");
' Use the underlying StringBuilder for more complex 
' manipulations of the string.
strWriter.GetStringBuilder().Insert(0, "Invalid ")

Remarks

This is either the StringBuilder that was passed to the constructor, or the StringBuilder that was automatically created.

The following table lists examples of other typical or related I/O tasks.

To do this... See the example in this topic...
Create a text file. How to: Write Text to a File
Write to a text file. How to: Write Text to a File
Read from a text file. How to: Read Text from a File

Applies to

See also