js startWith

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

  

posted @ 2015-06-25 10:47  金色海  阅读(2025)  评论(0编辑  收藏  举报