> On Mar 13, 2018, at 3:49 PM, John Rose <john.r.r...@oracle.com> wrote: > > On Mar 13, 2018, at 6:47 AM, Jim Laskey <james.las...@oracle.com> wrote: >> >> … >> A. Line support. >> >> public Stream<String> lines() >> > > Suggest factoring this as: > > public Stream<String> splits(String regex) { }
+1 This is a natural companion to the existing array returning method (as it was the case on Pattern when we added splitAsStream), where one can use a limit() operation to achieve the same effect as the limit parameter on the array returning method. > public Stream<String> lines() { return splits(`\n|\r\n?`); } > See also Files/BufferedReader.lines. (Without going into details Files.lines has some interesting optimizations.) Paul.