pub fn join<B, T, I>(separator: B, elements: I) -> BString
Expand description
Join the elements given by the iterator with the given separator into a
single BString
.
Both the separator and the elements may be any type that can be cheaply
converted into an &[u8]
. This includes, but is not limited to,
&str
, &BStr
and &[u8]
itself.
ยงExamples
Basic usage:
use bstr;
let s = bstr::join(",", &["foo", "bar", "baz"]);
assert_eq!(s, "foo,bar,baz");