rightpad-str

Crates.iorightpad-str
lib.rsrightpad-str
version6.6.6
sourcesrc
created_at2023-06-08 13:43:27.706751
updated_at2023-06-08 13:43:27.706751
descriptionObviously the second best crate (after `leftpad-str`) for the Rust programming language. The crate serves the only goal of implementing `rightpad` function.
homepage
repositoryhttps://github.com/abs0luty/rightpad
max_upload_size
id885503
size534,017
Adi Salimgereev (abs0luty)

documentation

https://docs.rs/rightpad-str

README

rightpad-str crate.

Obviously the second best crate (after leftpad-str) for the Rust programming language. The crate serves the only goal of implementing rightpad function:

pub fn rightpad(input: &str, width: usize, padding_char: char) -> String;

Examples

assert_eq!(rightpad("hello", 8, '*'), "hello***");
assert_eq!(rightpad("rust", 6, ' '), "rust  ");
Commit count: 1

cargo fmt