Javascript String tld()

Description

Javascript String tld()


String.prototype.tld = function(){
  str = this;//ww w  .j  a v a  2 s.c om
  str = str.substring(0, str.indexOf("/", 8));
  
 return (m = str.match(new RegExp("\.([a-z,A-Z]{2,6})$") )) ? m[1] : false;
};



PreviousNext

Related