Trim whitespace in the input string