Crates.io | pad_left |
lib.rs | pad_left |
version | 0.1.2 |
source | src |
created_at | 2023-05-04 16:48:06.766168 |
updated_at | 2023-05-04 17:21:53.305189 |
description | A simple library to left pad a string with a given character up to a certain length. |
homepage | |
repository | https://github.com/wiseaidev/pad-left |
max_upload_size | |
id | 856886 |
size | 17,758 |
A simple library to left pad a string with a given character up to a certain length.
use pad_left::left_pad;
fn main() {
assert_eq!(left_pad("hello".to_string(), 15, 'π'), "ππππππππππhello".to_string());
}
cargo test
cargo doc --open