trim all string prpoerties of an object
171610
function trimStringProperties (obj) {

    if (obj !== null && typeof obj === 'object') {

        for ( var prop in obj ) {

            // if the property is an object trim it too
            if ( typeof obj[prop] === 'object' ) {
                return trimStringProperties(obj[prop]);
            } 
            
            // if it's a string remove begin and end whitespaces
            if ( typeof obj[prop] === 'string' ) {
                obj[prop] = obj[prop].trim();
            }

        }

    }

}
57968
public String trimLeading(String str) {
        if (str == null) {
            return null;
        }

        int length = str.length();
        for (int i=0; i<length; i++) {
            if (str.charAt(i) > ' ') {
                return str.substring(i);
            }
        }

        return "";
    }
388117
function wash(obj) {
	if (!obj) {
		return {};
	}

	var keys = Object.keys(obj);
	for (var i = 0; i < keys.length; i++) {
		var key = keys[i];

		if (obj[key] === undefined) {
			delete obj[key];
		}
	}

	return obj;
}
892771
def _trim(self, somestr):
        
        tmp = RE_LSPACES.sub("", somestr)
        tmp = RE_TSPACES.sub("", tmp)
        return str(tmp)
396056
function ( obj ) {
		obj = string.trim( obj );

		return obj.charAt( 0 ).toLowerCase() + obj.slice( 1 );
	}
70576
function clean(parts) {
    var p = '';
    for (var i = 0; i < parts.length; i += 3) {
        p += parts[i] || '';
    }
    return p;
}
1364142
function obj2str(obj) {
  return Object.getOwnPropertyNames(obj).map(function (key) {
    return encodeURIComponent(key) + '=' + encodeURIComponent(obj[key]);
  }).join('&');
}
810576
function stringify(obj) {
  if (obj instanceof RegExp) return obj.toString();
  return JSON.stringify(obj, null, 2);
}
599689
def clean_line(str, delimiter):
    """"""

    return [x.strip() for x in str.strip().split(delimiter) if x != '']
1182918
function ( obj, arg ) {
		arg = arg || ",";

		return string.trim( obj ).split( new RegExp( "\\s*" + arg + "\\s*" ) );
	}
855726
function strCompact(str) {
        return this.trim(str).replace(/([\r\n\s])+/g, function (match, whitespace) {
            return whitespace === '　' ? whitespace : ' ';
        });
    }
809341
function (s) {
          s = Tools.trim(s);

          function rep(re, str) {
            s = s.replace(re, str);
          }

          // example: <strong> to [b]
          rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi, "[url=$1]$2[/url]");
          rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi, "[code][color=$1]$2[/color][/code]");
          rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi, "[quote][color=$1]$2[/color][/quote]");
          rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, "[code][color=$1]$2[/color][/code]");
          rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, "[quote][color=$1]$2[/color][/quote]");
          rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi, "[color=$1]$2[/color]");
          rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, "[color=$1]$2[/color]");
          rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi, "[size=$1]$2[/size]");
          rep(/<font>(.*?)<\/font>/gi, "$1");
          rep(/<img.*?src=\"(.*?)\".*?\/>/gi, "[img]$1[/img]");
          rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi, "[code]$1[/code]");
          rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi, "[quote]$1[/quote]");
          rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi, "[code][b]$1[/b][/code]");
          rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi, "[quote][b]$1[/b][/quote]");
          rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi, "[code][i]$1[/i][/code]");
          rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi, "[quote][i]$1[/i][/quote]");
          rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi, "[code][u]$1[/u][/code]");
          rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi, "[quote][u]$1[/u][/quote]");
          rep(/<\/(strong|b)>/gi, "[/b]");
          rep(/<(strong|b)>/gi, "[b]");
          rep(/<\/(em|i)>/gi, "[/i]");
          rep(/<(em|i)>/gi, "[i]");
          rep(/<\/u>/gi, "[/u]");
          rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi, "[u]$1[/u]");
          rep(/<u>/gi, "[u]");
          rep(/<blockquote[^>]*>/gi, "[quote]");
          rep(/<\/blockquote>/gi, "[/quote]");
          rep(/<br \/>/gi, "\n");
          rep(/<br\/>/gi, "\n");
          rep(/<br>/gi, "\n");
          rep(/<p>/gi, "");
          rep(/<\/p>/gi, "\n");
          rep(/&nbsp;|\u00a0/gi, " ");
          rep(/&quot;/gi, "\"");
          rep(/&lt;/gi, "<");
          rep(/&gt;/gi, ">");
          rep(/&amp;/gi, "&");

          return s;
        }
483174
def _clean(self, value):
		""""""
		
		value = (str(v) for v in value)
		
		if self.strip:
			value = (v.strip() for v in value)
		
		if not self.empty:
			value = (v for v in value if v)
		
		return value
1004696
function objectToQueryString (obj) {
    let qs = reduce(obj, (result, value, key) => {
        if (!isNull(value) && !isUndefined(value)) {
            if (isArray(value)) {
                result += reduce(value, (result1, value1) => {
                    if (!isNull(value1) && !isUndefined(value1)) {
                        result1 += key + '=' + value1 + '&';
                        return result1
                    } else {
                        return result1;
                    }
                }, '')
            } else {
                result += key + '=' + value + '&';
            }
            return result;
        } else {
            return result
        }
    }, '').slice(0, -1);
    return qs;
}
134610
function(object) {
    // if we're not an array or object, return the primative
    if (object !== Object(object)) {
      return object;
    }

    var decamelizeString = function(string) {
      var separator = '_';
      var split = /(?=[A-Z])/;

      return string.split(split).join(separator).toLowerCase();
    };


    var output;
    if (object instanceof Array) {
      output = [];
      for(var i = 0, l = object.length; i < l; i++) {
        output.push(decamelizeKeys(object[i]));
      }
    } else {
      output = {};
      for (var key in object) {
        if (object.hasOwnProperty(key)) {
          output[decamelizeString(key)] = decamelizeKeys(object[key]);
        }
      }
    }

    return output;
  }
952773
function stringifyObject(object, indent) {
  return Object.keys(object).reduce((string, key, index) => {
    const script = object[key]
    let value
    if (isPlainObject(script)) {
      value = `{${stringifyObject(script, `${indent}  `)}\n${indent}}`
    } else {
      value = `'${escapeSingleQuote(script)}'`
    }
    const comma = getComma(isLast(object, index))
    return `${string}\n${indent}${key}: ${value}${comma}`
  }, '')
}
670266
def trim_trailing_silence(obj):
    
    _check_supported(obj)
    copied = deepcopy(obj)
    length = copied.get_active_length()
    copied.pianoroll = copied.pianoroll[:length]
    return copied