On Thu, 25 Jan 2018, Sven Schreiber wrote:
in git I see that a new function linesplit() is coming: "Returns
an array of
strings, one per line in the argument"
Could this get a second optional argument that would override the newline
character for splitting?
In a word, no: linesplit (if it survives) splits on newlines and
that's it.
When I wanted this functionality I looked at strsplit(), which splits
on whitespace, and considered adding an optional separator argument.
However, strsplit already has an optional second argument (to grab an
single element) and I thought it was maybe over-complicated to add
another.
Perhaps I was being too conservative; if we reckon it's OK to have two
optional arguments to strsplit we could add the separator option. In
that case we might junk linesplit, which isn't in a release at this
point, in favour of strsplit(s,,"\n").
Allin