split ( seq separators -- pieces )
Factor handbook » The language » Collections » Sequence operations » Splitting sequences

Prev:split1-last-slice ( seq subseq -- before-slice after-slice )
Next:split-indices ( seq indices -- pieces )


Vocabulary
splitting

Inputs
seqa sequence
separatorsa sequence


Outputs
piecesa new array


Word description
Splits seq at each occurrence of an element of separators and outputs an array of pieces. The pieces do not include the elements along which the sequence was split.

Examples
USING: prettyprint splitting ; "hello world-how are you?" " -" split .
{ "hello" "world" "how" "are" "you?" }


Definition