-
Notifications
You must be signed in to change notification settings - Fork 15
cut
Mahmoud Ben Hassine edited this page Nov 21, 2015
·
4 revisions
Splits a String by a delimiter and extract fields.
Name | Type | Mandatory | Default |
---|---|---|---|
delimiter | String | Yes | N/A |
field | int | Yes | N/A |
Stream<String> stream = Stream.of("a;b", "c;d");
UnixStream.unixify(stream)
.cut(";",2)
.to(stdOut()); // prints "b", "d"
// Or
UnixStream.from(stream)
.pipe(cut(";",2))
.to(stdOut()); // prints "b", "d"
// Or
stream
.map(Functions.cut(";", 2))
.forEach(System.out::println); // prints "b", "d"
UnixStream is created with passion by Mahmoud Ben Hassine