cut* ( seq n -- before after )
Factor handbook » The language » Collections » Sequence operations » Subsequences and slices

Prev:cut ( seq n -- before after )
Next:slice


Vocabulary
sequences

Inputs
seqa sequence
na non-negative integer


Outputs
beforea sequence
aftera sequence


Word description
Outputs a pair of sequences, where after consists of the last n elements of seq, while before holds the remaining elements. Both output sequences have the same type as seq.

See also
cut, cut-slice, cut-slice*

Definition


: cut* ( seq n -- before after ) [ head* ] [ tail* ] 2bi ;