JS 实现 startWith endWith函数

 String.prototype.startWith = function(s) { 
if (s == null || s == "" || this.length == 0 || s.length > this.length)
return false;
if (this.substr(0, s.length) == s)
return true;
else
return false;
return true;
} String.prototype.endWith = function(s) {
if (s == null || s == "" || this.length == 0|| s.length > this.length)
return false;
if (this.substring(this.length - s.length) == s)
return true;
else
return false;
return true;
}
上一篇:在代码中创建Drawable资源


下一篇:Oracle中rank() over, dense_rank(), row_number() 的区别