strunc

Crates.iostrunc
lib.rsstrunc
version0.1.1
sourcesrc
created_at2022-08-12 01:50:17.653697
updated_at2022-08-12 01:52:55.012083
descriptionString truncation with suffixes
homepage
repository
max_upload_size
id643691
size4,918
James Little (jameslittle230)

documentation

README

Strunc

A string truncating crate.

let output = "very long string".strunc_len(10);
assert_eq!("very lo...", output.to_string());

Different options:

// Default:
"very long string is very long".strunc(); // truncates to 25 characters

// Customize the suffix:
let output = "very long string".strunc_len_suf(15, "....");
assert_eq!("very long s....", output);
Commit count: 0

cargo fmt