String.prototype.trim = function() {
    return this.replace(/\n/gi, "").replace(/(^ *)|( *$)/g, "");
}
String.prototype.ltrim = function() {
return this.replace(/\n/gi, "").replace(/(^ *)/g, "");
}
String.prototype.rtrim = function() {
return this.replace(/\n/gi, "").replace(/( *$)/g, "");
}
