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

trim

Synopsis

Trims a String by removing trailing white spaces.

Parameters

N/A

Example

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

UnixStream.unixify(stream)
   .trim()
   .to(stdOut()); // prints "a", "b c"

// Or

UnixStream.from(stream)
   .pipe(trim())
   .to(stdOut()); // prints "a", "b c"

// Or

stream
    .map(Functions.trim())
    .forEach(System.out::println); // prints "a", "b c"
Clone this wiki locally