text property

Range.text property

Gets the text of the range.

@property
def text(self) -> str:
    ...

Remarks

The returned string includes all control and special characters as described in ControlChar.

Examples

Shows how to get the text contents of all the nodes that a range covers.

doc = aw.Document()
builder = aw.DocumentBuilder(doc)
builder.write('Hello world!')
self.assertEqual('Hello world!', doc.range.text.strip())

See Also