Trimming Whitespace in BASH

This function will trim leading and trailing tab and space characters from a string: