1 stable release
6.6.6 | Jun 8, 2023 |
---|
#340 in Value formatting
530KB
62 lines
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 ");
lib.rs
:
rightpad-str
crate.
Obviously the second best crate (after leftpad-str
) for the Rust programming language. The crate serves the only goal of implementing leftpad
function:
pub fn rightpad(input: &str, width: usize, padding_char: char) -> String;