Crate ellipse

Source
Expand description

Truncate and ellipse strings in a human-friendly way.

Uses unicode extended grapheme clusters.

ยงExample

use ellipse::Ellipse;

let input = "๐Ÿ‡ฉ๐Ÿ‡ช๐Ÿ‡ฌ๐Ÿ‡ง๐Ÿ‡ฎ๐Ÿ‡น๐Ÿ‡ซ๐Ÿ‡ท";
assert_eq!(&input.truncate_ellipse(2), "๐Ÿ‡ฉ๐Ÿ‡ช๐Ÿ‡ฌ๐Ÿ‡ง...");

Traitsยง

  • Truncate and ellipse strings in a human-friendly way.