Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
// sentencecase.js
/* global adventurejs A */

/**
 * Capitalizes the first char of a string.
 * @method adventurejs#sentencecase
 * @memberOf adventurejs
 * @param {String} string
 * @returns {String}
 */
adventurejs.sentencecase = function Adventurejs_sentencecase(string) {
  if ("string" !== typeof string) return "";
  string = string.charAt(0).toUpperCase() + string.slice(1);
  return string;
};