Add Iterables.intersperse()
Issue #22
resolved
Add a function intersperse, that takes an element and an Iterable and "intersperses" that element between the elements of the Iterable. For example:
Iterables.intersperse(Arrays.asList(1, 2, 3), 0)
will return 1, 0, 2, 0, 3.
Comments (2)
-
reporter -
- changed status to resolved
fixed in commit 50bb08827988ba81dc2fda4d767089e2fad28a9d should be released 2.3
- Log in to comment
A good use case: you want to print multiple strings with a line between each two strings:
This will print: