NeoLegends / ellipse

Truncate strings in a human-friendly way.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ellipse

Travis CI Status crates.io Documentation

Truncate and ellipse strings in a human-friendly way. Uses unicode extended grapheme clusters.

Documentation

Example

use ellipse::Ellipse;

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

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

Truncate strings in a human-friendly way.


Languages

Language:Rust 92.1%Language:HCL 7.9%