Function reword::and_join

source ·
pub fn and_join<I>(iter: I) -> Stringwhere
    I: IntoIterator,
    I::Item: AsRef<str>,
Expand description

Join the list with an ‘and’ before the last element of the list.

Examples

assert_eq!(reword::and_join(&["a", "b"]), "a and b");
assert_eq!(reword::and_join(&["a", "b", "c"]), "a, b and c");