源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

js substring从右边获取指定长度字符串(示例代码)

  • 时间:2022-12-01 01:31 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:js substring从右边获取指定长度字符串(示例代码)
如下所示:
[u]复制代码[/u] 代码如下:
 /*    Get the rightmost substring, of the specified length,    from a String object. */  String.prototype.right = function (length_)  {          var _from = this.length - length_;          if (_from < 0) _from = 0;          return this.substring(this.length - length_, this.length);  }; 
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部