_sub(t: text, start: int = 0, len: int = _length(t)): text

Extracts from t and returns a byte sequence of length len beginning at byte start.  Boundary cases are handled as follows:

_sub("foobarbaz", 3, 3) == "bar"
_sub("y_foo.mnd", 6) == "mnd"

_sub(l: list, start: int = 0, len: int = _length(l)): list

Returns the sub-list of l of length len starting at element start. Boundary cases are handled in the same way they are for the text version of _sub.

_sub(<>, 2, 4) == <>
_sub(<"abc", 1, 2, 3,>, 1) == <1, 2, 3>

_sub(b: binding, start: int = 0, len: int = _length(b)): binding

Returns the sub-binding of b of length len starting at element start. Boundary cases are handled in the same way they are for the text version of _sub.

_sub([ foo = 1, bar = 2, moxy = TRUE,
       msg = "Bad system call (core dumped)" ], 1, 2) == [ bar = 2, moxy = TRUE ]
_sub([ foo/a = 1, bar/b = 2 ], 1) == [ bar/b = 2 ]

Kenneth C. Schalk <ken@xorian.net> / Primitive Functions / Vesta SDL Programmer's Reference