Trim whitespace characters from beginning and end of a string.
input string
trimmed string
var out = trim( ' Whitespace ' ); // returns 'Whitespace'
var out = trim( '\t\t\tTabs\t\t\t' ); // returns 'Tabs'
var out = trim( '\n\n\nNew Lines\n\n\n' ); // returns 'New Lines'
Trim whitespace characters from beginning and end of a string.