Function string_template_plus::transformers::trim
source · pub fn trim(val: &str, args: Vec<&str>) -> Result<String, TransformerError>
Expand description
Trim the given string with given patterns one after another
assert_eq!(trim("nata", vec!["a"])?, "nat");
assert_eq!(trim(" \tnata\t ", vec![])?, "nata");
assert_eq!(trim("hi there! ", vec![" ", "!"])?, "hi there");
assert_eq!(trim("hi there! ", vec![" !", "ih"])?, " there");