Trim leading and trailing whitespaces from strings.