[−][src]Trait ellipse::Ellipse
Truncate and ellipse strings in a human-friendly way.
Example
use ellipse::Ellipse; let input = "🇩🇪🇬🇧🇮🇹🇫🇷"; assert_eq!(&input.truncate_ellipse(2), "🇩🇪🇬🇧...");
Associated Types
type Output
Required methods
fn truncate_ellipse_with(&self, len: usize, ellipse: &str) -> Self::Output
Truncate to a length of len
extended grapheme clusters and place the given
ellipse string at the end when truncating.
Truncating to a length of 0 will yield the empty element without an attached ellipsis.
Provided methods
fn truncate_ellipse(&self, len: usize) -> Self::Output
Truncate to a length of len
extended grapheme clusters and add ...
at
the end of the string when truncating.
Truncating to a length of 0 will yield the empty element without an attached ellipsis.