Crates.io | leftpad-str |
lib.rs | leftpad-str |
version | 9.9.9 |
source | src |
created_at | 2023-06-08 12:26:35.88604 |
updated_at | 2023-06-08 13:49:51.725412 |
description | Obviously the best crate for the Rust programming language. The crate serves the only goal of implementing `leftpad` function. |
homepage | |
repository | https://github.com/abs0luty/leftpad |
max_upload_size | |
id | 885462 |
size | 540,169 |
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;
assert_eq!(leftpad("hello", 8, '*'), "***hello");
assert_eq!(leftpad("rust", 6, ' '), " rust");