Function reword::name_with_limit

source ·
pub fn name_with_limit<T: AsRef<str>>(t: T, limit: usize) -> String
Expand description

Formats the input string as a name and limits the length of the name.

Examples

let t = "(Even),Olsson&Rogstadkjærnet?";
assert_eq!(reword::name_with_limit(t, 4), "EOR");
assert_eq!(reword::name_with_limit(t, 25), "Even O Rogstadkjærnet");