Javascript String replaceExtension(newExtension)

Description

Javascript String replaceExtension(newExtension)

String.prototype.replaceExtension = function (newExtension) {
  return this.substring(0, this.lastIndexOf('.')) + newExtension;
}



PreviousNext

Related