Aspose::Words::Range::get_Text method

Range::get_Text method

Gets the text of the range.

System::String Aspose::Words::Range::get_Text()

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.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);

builder->Write(u"Hello world!");

ASSERT_EQ(u"Hello world!", doc->get_Range()->get_Text().Trim());

See Also