joinToString
Joins the elements of the Flow into a single string using the provided f function to transform each element to a string.
Return
A String containing the concatenated strings of the flow elements.
Example usage:
flowOf(1, 2, 3, 6, 5, 4)
.joinToString { "$it" }
.also(::println) //123654
Parameters
Joins the elements of the Flow into a single string, separated by the specified between string, using the provided f function to transform each element to a string.
Return
A String containing the concatenated strings of the flow elements, separated by the between string.
Example usage:
flowOf(1, 2, 3, 6, 5, 4)
.joinToString(", ") { "$it" }
.also(::println) //1, 2, 3, 6, 5, 4
Parameters
A String used as a separator between the flow elements.
Joins the elements of the Flow into a single string, enclosed by the specified start and end strings, and separated by the specified between string. Uses the provided f function to transform each element to a string.
Return
A String containing the concatenated strings of the flow elements, enclosed by start and end, and separated by the between string.
Example usage:
flowOf(1, 2, 3, 6, 5, 4)
.joinToString("[", ", ", "]") { "$it" }
.also(::println) //[1, 2, 3, 6, 5, 4]