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 and outputs
seqa sequence
separatorsa sequence
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