Skip to main content

StrJoin

Trait StrJoin 

Source
pub trait StrJoin {
    // Required method
    fn join(self, join: &str) -> String;
}
Expand description

A custom String-join trait as the stdlib one is currently marked as unstable.

Required Methods§

Source

fn join(self, join: &str) -> String

Join an iterator of things that can be referenced as strings into a single owned-string by the given joining string

§Example
use rs_es::util::StrJoin;

let data = vec!["a", "b", "c", "d"];
assert_eq!("a-b-c-d", data.iter().join("-"));

This will print: a-b-c-d

Implementors§

Source§

impl<I, S> StrJoin for I
where S: AsRef<str>, I: Iterator<Item = S>,