split-lines ( seq -- seq' )
Factor handbook » The language » Collections » Sequence operations » Splitting sequences

Prev:split-when-slice ( ... seq quot: ( ... elt -- ... ? ) -- ... pieces )
Next:replace ( seq old new -- new-seq )


Vocabulary
splitting

Inputs
seqa sequence


Outputs
seq'a sequence of strings


Word description
Splits a string along line breaks.

Notes
These are considered line breaks:
\nLine Feed
\rCarriage Return
\r\nCarriage Return + Line Feed
\vLine Tabulation
\fForm Feed
\x1cFile Separator
\x1dGroup Separator
\x1eRecord Separator
\x85Next Line (C1 Control Code)
\u002028Line Separator
\u002029Paragraph Separator


Examples
USING: prettyprint splitting ; "Hello\r\nworld\n" split-lines .
{ "Hello" "world" }


Definition


Methods