left-pad

Crates.ioleft-pad
lib.rsleft-pad
version1.0.1
sourcesrc
created_at2016-03-24 08:28:18.093718
updated_at2016-03-24 09:06:25.860548
descriptionProvides left-padding for strings.
homepagehttps://futile.github.io/leftpad-rs
repositoryhttps://github.com/futile/leftpad-rs.git
max_upload_size
id4545
size5,065
Felix Rath (futile)

documentation

https://futile.github.io/leftpad-rs

README

leftpad-rs

This crate provides generic left-padding functions for strings, including both &str and String.

Import with extern crate left_pad;.

Link to the documentation

Usage example:

use left_pad::{leftpad, leftpad_with};

assert_eq!(leftpad("blubb", 7), "  blubb");
assert_eq!(leftpad_with("blubb", 7, '.'), "..blubb");

let s: String = "blubb".to_owned();
assert_eq!(leftpad(s, 7), "  blubb");
Commit count: 13

cargo fmt