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; }

你可能感兴趣的:(JavaScript)