Global.String.prototype.capitalize (limit)
transforms the first n characters of a string to uppercase

  • Parameter Number:
    amount of characters to transform
  • Returns
    String the resulting string
Sourcecode in /home/hannes/helma/modules/core/String.js:
293:   String.prototype.capitalize = function(limit) {
294:       if (limit == null)
295:           limit = 1;
296:       var head = this.substring(0, limit);
297:       var tail = this.substring(limit, this.length);
298:       return head.toUpperCase() + tail.toLowerCase();
299:   }