-
Notifications
You must be signed in to change notification settings - Fork 15
Mahmoud Ben Hassine edited this page Nov 21, 2015
·
4 revisions
Replaces patterns with expressions in a stream of Strings.
Name | Type | Mandatory | Default |
---|---|---|---|
regexp | String | Yes | N/A |
replacement | String | Yes | N/A |
Stream<String> stream = Stream.of("a", "ab");
UnixStream.unixify(stream)
.tr("a", "b")
.to(stdOut()); // prints "b", "bb"
// Or
UnixStream.from(stream)
.pipe(tr("a", "b"))
.to(stdOut()); // prints "b", "bb"
// Or
stream
.map(Functions.tr("a", "b"))
.forEach(System.out::println); // prints "b", "bb"
UnixStream is created with passion by Mahmoud Ben Hassine