GitHunt
AB

abs0luty/leftpad

๐Ÿ’ฅ Crate for left padding a string in the Rust programming language.

leftpad-str crate.

Obviously the best crate for the Rust programming language. The crate serves the only goal of implementing leftpad function:

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

Examples

assert_eq!(leftpad("hello", 8, '*'), "***hello");
assert_eq!(leftpad("rust", 6, ' '), "  rust");

Contributors

MIT License
Created June 8, 2023
Updated December 26, 2023
abs0luty/leftpad | GitHunt