collapse_chars function

Collapse character inputs x into a single string.