slice

fun slice(from: DocPos, to: DocPos = endPos): Text

Retrieve the text between the given points.