function trimString(string) {
  if (string.trim) {
    return string.trim();
  }

  return string.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
}
/**
 * Removes the leading and trailing white space and line terminator characters from a string.
 */
Removes the leading and trailing white space and line terminator characters from a string.
Removes the leading and trailing white space and line terminator characters from a string .
function trimString(string) {
  if (string.trim) {
    return string.trim();
  }
  return string.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
}
function trimString ( string ) { if ( string . trim ) { return string . trim ( ) ; } return string . replace ( / ^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$ / g , '' ) ; }
Removes the leading and trailing white space and line terminator characters from a string.
Removes the leading and trailing white space and line terminator characters from a string .