Copies characters in the provided string between the Start and End position. By default, the End value will copy the remainder of the string. You can also specify negative positions for the Start or End, which will cause it to work backwards.
world.log << copytext("Foo Bar", 5) // Bar
world.log << copytext("Foo Bar", 1, 4) // Foo
world.log << copytext("Foo Bar", -3) // Bar
world.log << copytext("Foo Bar", -7, -3) // Foo
For non-ASCII strings, where the string position does not necessarily correlate to character position, you will need the _char
variant of this proc. copytext_char()
works in text elements, and otherwise functions identically.