#join #items #list #string #prefix #suffix #separator

join_to_string

Join a list of items to string/buffer

3 releases

Uses old Rust 2015

0.1.3 Jan 9, 2019
0.1.2 Jan 9, 2019
0.1.1 Aug 28, 2018
0.1.0 Aug 28, 2018

#2419 in Rust patterns

Download history 38/week @ 2023-11-27 31/week @ 2023-12-04 30/week @ 2023-12-11 34/week @ 2023-12-18 30/week @ 2023-12-25 30/week @ 2024-01-01 32/week @ 2024-01-08 33/week @ 2024-01-15 33/week @ 2024-01-22 32/week @ 2024-01-29 32/week @ 2024-02-05 47/week @ 2024-02-12 49/week @ 2024-02-19 64/week @ 2024-02-26 52/week @ 2024-03-04 54/week @ 2024-03-11

225 downloads per month

MIT/Apache

7KB
66 lines

join

Build Status Crates.io API reference

Join a list of items to string:

extern crate join_to_string;
use join_to_string::join;

fn main() {
    let mut buf = String::new();
    join([1, 2, 3].iter())
        .separator(", ")
        .prefix("(")
        .suffix(")")
        .to_buf(&mut buf); // .to_string()
    assert_eq!(buf, "(1, 2, 3)");
}

No runtime deps