added functions to remove leading and/or trailing whitespace from strings