trim function

Trim leading and tailing spaces from string