Skip to content

compact

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

compact

Synopsis

Compacts a String by removing all white spaces and tabs.

Parameters

N/A

Example

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

UnixStream.unixify(stream)
   .compact()
   .to(stdOut()); // prints "ab", "cd"

// Or

UnixStream.from(stream)
   .pipe(compact())
   .to(stdOut()); // prints "ab", "cd"

// Or

stream
  .map(Functions.compact())
  .forEach(System.out::println); // prints "ab", "cd"
Clone this wiki locally