pub fn join<T, I, J>(iterator: I, joiner: J) -> Join<I::IntoIter, J>
Expand description
Concatenate iterator elements, separating each element pair with a given joiner.
Equivalent to slice::join
.
The iterator must be cloneable, because Display objects may be printed multiple times.
let strings = &["hello", "wonderful", "world"];
let output = join(strings, ", ");
assert_eq!(output.to_string(), "hello, wonderful, world");