<script type="text/javascript">
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;
}
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;
}
</script>
JS中定义String方法-StartWith及EndWith
最新推荐文章于 2024-07-04 14:54:41 发布