if (!"".trimLeft) { String.prototype.trimLeft = function () { return this.replace(/^\s+/, ""); }; } var VResult = str.trimLeft();