https://github.com/wiseaidev/pad-left
A simple library to left pad a string with a given character up to a certain length.
https://github.com/wiseaidev/pad-left
left-pad pad padding rust
Last synced: 10 months ago
JSON representation
A simple library to left pad a string with a given character up to a certain length.
- Host: GitHub
- URL: https://github.com/wiseaidev/pad-left
- Owner: wiseaidev
- License: apache-2.0
- Created: 2023-05-04T16:39:25.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-04T17:21:40.000Z (over 2 years ago)
- Last Synced: 2025-03-05T06:56:55.565Z (11 months ago)
- Topics: left-pad, pad, padding, rust
- Language: Rust
- Homepage: https://docs.rs/pad_left/
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pad-left
A simple library to left pad a string with a given character up to a certain length.
## Usage
```rust
use pad_left::left_pad;
fn main() {
assert_eq!(left_pad("hello".to_string(), 15, 'π'), "ππππππππππhello".to_string());
}
```
## Run tests
```sh
cargo test
```
## Build & Open Docs
```sh
cargo doc --open
```