remove leading or trailing white space from input