abbreviator

Crates.ioabbreviator
lib.rsabbreviator
version0.1.9
sourcesrc
created_at2020-07-20 17:18:50.232927
updated_at2024-01-09 10:14:13.4637
descriptionA library for abbreviating long words.
homepage
repositoryhttps://github.com/Vagelis-Prokopiou/abbreviator
max_upload_size
id267318
size6,251
Vagelis Prokopiou (Vagelis-Prokopiou)

documentation

README

Actions Status

abbreviator

A Rust library for abbreviating long words.

Example usage

Add the library to your dependencies

[dependencies]
abbreviator = "0.1.8"

and then use it.

use abbreviator::abbreviate;

fn main() {
    println!("{}", abbreviate("")); // prints ""
    println!("{}", abbreviate("a")); // prints "a"
    println!("{}", abbreviate("ab")); // prints "ab"
    println!("{}", abbreviate("abc")); // prints "a1c"
    println!("{}", abbreviate("word")); // prints "w2d"
    println!("{}", abbreviate("localization")); // prints "l10n"
    println!("{}", abbreviate("internationalization")); // prints "i18n"
    println!("{}", abbreviate("pneumonoultramicroscopicsilicovolcanoconiosis")); // prints "p43s"
}
Commit count: 29

cargo fmt