`

javascript endwith startwith

阅读更多

String.prototype.endsWith = function(suffix) {
    return this.indexOf(suffix, this.length - suffix.length) !== -1;
};

 

 

 

function endsWith(str, suffix) {
    return str.indexOf(suffix, str.length - suffix.length) !== -1;
}

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics