Crates.io | string-join |
lib.rs | string-join |
version | 0.1.2 |
source | src |
created_at | 2021-02-09 14:28:43.975387 |
updated_at | 2021-02-11 13:56:01.826578 |
description | A python-like way to join items in an iterator with a separator |
homepage | https://gitlab.com/pwoolcoc/string-join |
repository | https://gitlab.com/pwoolcoc/string-join |
max_upload_size | |
id | 352785 |
size | 45,459 |
= String join
A helper trait for joining an iterator by a string-like thing using a python-like syntax
== Usage
use string_join::Join
"=>".join(["a", "b"].iter().cycle().take(5)); // => "a=>b=>a=>b=>a" " ".join(&["a", "b", "c"]); // => "a b c"
let mut f = File::write("foo.txt").unwrap(); "\n".write_join(&mut f, &["a", "b", "c"]); // std::io::Result<5> (writes joined string to writer and returns a result // with either the number of bytes written, or a std::io::Error