String.prototype.startsWith = function(prefix) {
return this.indexOf(prefix) === 0;
}
String.prototype.endsWith = function(suffix) {
return this.match(suffix+"$") == suffix;
};
Javascript String StartWith endWith
最新推荐文章于 2025-06-20 11:41:16 发布