Don't mangle the input strings. The caller may want to reuse it later.