Crate string_join[][src]

String join

Uses a python-like syntax to join any iterator-like thing with any string-like thing

Example

use string_join::Join;

assert_eq!("=".join(&["a", "b", "c"]), String::from("a=b=c"));

You can also write a joined collection directly to an io::Writer

use std::fs::File;
use string_join::Join;

let mut f = File::create("foo.txt")?;
"\n".write_join(&mut f, &["a", "b", "c"])?; // => writes `a\nb\nc` to the writer and returns
                                            //    the number of bytes written (5, in this case)

Traits

Join

This trait brings the join and write_join methods into scope for anything that implements AsRef<str>.