strip leading and trailing whitespace from input string before process