intersperse
Intersperses the elements of the Flow with the specified start, between, and end elements.
Return
A new Flow with the start, between, and end elements inserted between and around the original flow elements.
Example usage:
flowOf(1, 2, 3)
.intersperse(start = 0, between = -1, end = 4)
.collect(::println) //0, 1, -1, 2, -1, 3, 4
Content copied to clipboard