码迷,mamicode.com
首页 > Web开发 > 详细

JS endWith

时间:2020-06-02 19:02:49      阅读:63      评论:0      收藏:0      [点我收藏+]

标签:ant   blog   调用   dex   code   lock   csdn   OLE   https   

参考地址

代码

String.prototype.endWith = function (endStr) {
    var d = this.length - endStr.length;
    return (d >= 0 && this.lastIndexOf(endStr) == d);
}

调用

var str="I love antzone";
console.log(str.endWith("ne"));

JS endWith

标签:ant   blog   调用   dex   code   lock   csdn   OLE   https   

原文地址:https://www.cnblogs.com/Alex-Mercer/p/13032825.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!