Partilhar via


TextBuffer.setText(String) Method

Definition

Sets the content of the TextBuffer object to the specified string, overwriting any existing content.

public:
 virtual void setText(System::String ^ _string);
public virtual void setText (string _string);
abstract member setText : string -> unit
override this.setText : string -> unit
Public Overridable Sub setText (_string As String)

Parameters

_string
String

A string that contains the new text for the TextBuffer object.

Remarks

If the TextBuffer object contains any content, it is overwritten by the new content.

The following example demonstrates the setText method.

{ 
    TextBuffer txtb = new TextBuffer(); 
    txtb.setText("This is the first text."); 
    // Now txtb contains exactly that text. 
}

Applies to