Skip to content

unexpand

Mahmoud Ben Hassine edited this page Nov 21, 2015 · 4 revisions

unexpand

Synopsis

Replaces spaces with tabs in a stream of Strings.

Parameters

N/A

Example

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

UnixStream.unixify(stream)
   .unexpand()
   .to(stdOut()); // prints "a\tb", "b\t\tc"

// Or

UnixStream.from(stream)
   .pipe(unexpand())
   .to(stdOut()); // prints "a\tb", "b\t\tc"

// Or

stream
    .map(Functions.unexpand())
    .forEach(System.out::println); // prints "a\tb", "b\t\tc"
Clone this wiki locally