[−][src]Trait joinery::join::Separator
A trait for using a separator to produce a Join
.
This trait provides a more python-style interface for performing joins.
Rather use collection.join_with
, you can instead
use:
use joinery::Separator; let join = ", ".separate([1, 2, 3, 4]); assert_eq!(join.to_string(), "1, 2, 3, 4");
By default, Separator
is implemented for char
and &str
, as
well as all the separator types in separators
.
Note that any type can be used as a separator in a Join
when
creating one via Joinable::join_with
. The Separator
trait and its
implementations on char
and &str
are provided simply as
a convenience.