Skip to main content

pad

Function pad 

Source
pub fn pad(value: &str, columns: usize) -> String
Expand description

Pad a string on the right to columns display columns, cutting it if it is longer.

use majordomus_cli::environment::text::{pad, width};
assert_eq!(pad("ok", 5), "ok   ");
assert_eq!(width(&pad("日本語", 8)), 8);