Share via


TextBuffer.setText Method

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

Syntax

public void setText(str string)

Run On

Called

Parameters

  • string
    Type: str
    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.

Examples

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

See Also

TextBuffer Class

TextBuffer.getText Method

TextBuffer.appendText Method