abs0luty / leftpad

💥 Crate for left padding a string in the Rust programming language.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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");

About

💥 Crate for left padding a string in the Rust programming language.

License:MIT License


Languages

Language:Rust 100.0%