next | previous | forward | backward | up | top | index | toc | home
Macaulay2 > The Macaulay2 language > strings and nets > lines

lines -- split a string into lines

Description

lines s -- yields an array of strings obtained from the string s by breaking it at newline or return characters.
lines(nl,s) -- yields an array of strings obtained from the string s by breaking it at the newline characters specified by the string nl.

The form lines s is designed to break lines correctly when the file follows the Unix, MS-DOS, or Macintosh convention and contains no extraneous isolated newline or return characters. In other words, it will break a line at "\r\n", "\n", or "\r".

The string nl should be a string of length 1 or 2.

See also

Ways to use lines :