如下所示:复制代码代码如下: /*获取指定长度的最右边的子字符串,来自 String 对象。 */ String.prototype.right = 函数(length_) { var _from = this.length - length_;如果 (_from < 0) _from = 0;返回 this.substring(this.length - length_, this.length); };