Skip to content
Mahmoud Ben Hassine edited this page Oct 13, 2015 · 4 revisions

tr

Synopsis

Replaces patterns with expressions in a stream of Strings.

Parameters

Name Type Mandatory Default
regexp String Yes N/A
replacement String Yes N/A

Example

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

UStream.unixify(stream)
   .tr("a", "b")
   .to(stdOut()); // prints "b", "bb"

// Or

UStream.from(stream)
   .pipe(tr("a", "b"))
   .to(stdOut()); // prints "b", "bb"
Clone this wiki locally