//String関数を追加 String.prototype.left = function(le) { return this.substr(0, le); } String.prototype.mid = function(st, le) { if (st > 0) st--; return this.substr(st, isNaN(le) ? this.length : le); } String.prototype.right = function(le) { if(this.length < le) { return this; } else { return this.substr(this.length - le, le); } }