trimSpace function

Trim leading and/or trailing spaces in strings