Javascript String hyphenToHump()

Description

Javascript String hyphenToHump()



String.prototype.hyphenToHump = function () {
  return this.replace(/-(\w)/g, function () {
    return arguments[1].toUpperCase()
  })//from   w w  w . ja  v  a  2 s.  c o  m
}



PreviousNext

Related