trim_chars no longer takes a reference