Tuesday, April 30, 2013

javascript string replace regex

 function remove(key){  
      var reg=new RegExp('(^|,)'+key+'(,|$)');  
      new=old.replace(reg,',');  
      return new  
 }  

No comments:

Post a Comment