자바스크립트 replaceAll / trim

자바스크립트 replaceAll / trim

String.prototype.replaceAll = function(org,dest) {
 return this.split(org).join(dest);
}

String.prototype.trim = function() {
    return this.replace(/(^\s*)|(\s*$)/g, “”);
}