join

Function join 

Source
pub fn join<T, I, J>(iterator: I, joiner: J) -> Join<I::IntoIter, J>
where T: Display, I: IntoIterator<Item = T>, I::IntoIter: Clone, J: Display,
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");