static trim(str, ...chars) {
    chars =
      chars.length === 0 ? [' '] : Array.isArray(chars[0]) ? chars[0] : chars;

    let charMap = chars
        .map(c => {
          return typeof c === 'string' && c.length === 1 ? c : '';
        })
        .join(''),
      regExp1 = new RegExp(`^[${charMap}]+`),
      regExp2 = new RegExp(`[${charMap}]+$`);

    return str.replace(regExp1, '').replace(regExp2, '');
  }
/**
   * Trim one or more characters off the beginning and end of a given string
   *
   * @param {string} str          - String you want to trim
   * @param {Array<string>} chars - An array of strings, or multiple strings as arguments, to remove from the base string; defaults to a space
   * @returns {string}            - The trimmed string
   */
Trim one or more characters off the beginning and end of a given string
@param {string} str          - String you want to trim
@param {Array} chars - An array of strings, or multiple strings as arguments, to remove from the base string; defaults to a space
@returns {string}            - The trimmed string
Trim one or more characters off the beginning and end of a given string @param { string } str - String you want to trim @param { Array } chars - An array of strings or multiple strings as arguments to remove from the base string ; defaults to a space @returns { string } - The trimmed string
static trim(str, ...chars) {
    chars =
      chars.length === 0 ? [' '] : Array.isArray(chars[0]) ? chars[0] : chars;
    let charMap = chars
        .map(c => {
          return typeof c === 'string' && c.length === 1 ? c : '';
        })
        .join(''),
      regExp1 = new RegExp(`^[${charMap}]+`),
      regExp2 = new RegExp(`[${charMap}]+$`);
    return str.replace(regExp1, '').replace(regExp2, '');
  }
static trim ( str , ... chars ) { chars = chars . length === 0 ? [ ' ' ] : Array . isArray ( chars [ 0 ] ) ? chars [ 0 ] : chars ; let charMap = chars . map ( c => { return typeof c === 'string' && c . length === 1 ? c : '' ; } ) . join ( '' ) , regExp1 = new RegExp ( ` ${ charMap } ` ) , regExp2 = new RegExp ( ` ${ charMap } ` ) ; return str . replace ( regExp1 , '' ) . replace ( regExp2 , '' ) ; }
Trim one or more characters off the beginning and end of a given string
 @param {string} str          - String you want to trim
 @param {Array<string>} chars - An array of strings, or multiple strings as arguments, to remove from the base string; defaults to a space
 @returns {string}            - The trimmed string
Trim one or more characters off the beginning and end of a given string @param { string } str - String you want to trim @param { Array<string > } chars - An array of strings or multiple strings as arguments to remove from the base string ; defaults to a space @returns { string } - The trimmed string