Skip to content
Mahmoud Ben Hassine edited this page Nov 8, 2015 · 3 revisions

nl

Synopsis

Print line numbers of a stream of Strings.

Parameters

N/A

Example

Stream<String> stream = Stream.of("a", "b");

UnixStream.unixify(stream)
   .nl()
   .to(stdOut()); // prints "1 a", "2 b"

// Or

UnixStream.from(stream)
   .pipe(nl())
   .to(stdOut()); // prints "1 a", "2 b"
Clone this wiki locally