A basic JavaScript trim function to remove lead and trail white space and control characters. For use with HTAs and older browsers that don't support the built-in .trim() method.
trim(inputString);If inputString is not a string, an error message will be output to the console and the unchanged value will be returned.