Function join

Source
pub fn join<I, S>(
    input: I,
    separator: S,
) -> Result<JoinFilter<I, S>, Infallible>
where I: IntoIterator, I::Item: Display, S: Display,
Expand description

Joins iterable into a string separated by provided argument

/// ```jinja
/// <div>{{ example|join(", ") }}</div>
/// ```
#[derive(Template)]
#[template(ext = "html", in_doc = true)]
struct Example<'a> {
    example: &'a [&'a str],
}

assert_eq!(
    Example { example: &["foo", "bar", "bazz"] }.to_string(),
    "<div>foo, bar, bazz</div>"
);