DotNet技术研究

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

Javascript 构造endwith方法

代码例:
  <body>  
  <SCRIPT   LANGUAGE="JavaScript">  
  <!--  
  String.prototype.endWith=function(oString){  
  var   reg=new   RegExp(oString+"$");  
  return   reg.test(this);  
   
  }  
  alert("123".endWith("3"));  
  //-->  
  </SCRIPT> 

posted on 2006-05-11 21:17  <林海>  阅读(1580)  评论(1)    收藏  举报