?head ( seq begin -- newseq ? )
Factor handbook » The language » Collections » Sequence operations » Splitting sequences

Next:?head-slice ( seq begin -- newseq ? )


Vocabulary
splitting

Inputs
seqa sequence
begina sequence


Outputs
newseqa new sequence
?a boolean


Word description
Tests if seq starts with begin. If there is a match, outputs the subrange of seq excluding begin, and t. If there is no match, outputs seq and f.

Definition