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

/**
 * Capitalizes the first character of a string.
 * @method AdventureJS.Game#capitalize
 * @memberOf AdventureJS
 * @param {String} string
 * @returns {String}
 */
AdventureJS.FX.capitalize = function AdventureJS_capitalize(string) {
  if ("string" !== typeof string) return "";
  string = string.charAt(0).toUpperCase() + string.substring(1);
  return string;
};