#pad #padding #left-pad #rust

pad_left

A simple library to left pad a string with a given character up to a certain length

3 releases

0.1.2 May 4, 2023
0.1.1 May 4, 2023
0.1.0 May 4, 2023

#12 in #pad

29 downloads per month

Apache-2.0

7KB

pad-left

A simple library to left pad a string with a given character up to a certain length.

Usage

use pad_left::left_pad;

fn main() {
    assert_eq!(left_pad("hello".to_string(), 15, 'πŸš€'), "πŸš€πŸš€πŸš€πŸš€πŸš€πŸš€πŸš€πŸš€πŸš€πŸš€hello".to_string());
}

Run tests

cargo test

Build & Open Docs

cargo doc --open

No runtime deps