Javascript String GetName()

Description

Javascript String GetName()

String.prototype.GetName = function() {
 let str = this.toString();
 let nameRegex = /[^/\\]+\.[a-zA-Z]+$/;
 let match = str.match( nameRegex );
 if ( !match || match.length === 0 ) {
  return '';
 }
 return match[0];
};



PreviousNext

Related