pub fn center(s: &str, width: usize) -> StringExpand description
Returns a centered string of length width.
Padding is done with spaces.
It’s similar to Python’s str.center().
§Examples
let text = "*";
let result = jabba_lib::jstring::center(text, 3);
assert_eq!(result, " * ");