Pre-release
Adventure.js Docs Downloads
Score: 0 Moves: 0
//propercase.js
/*global adventurejs A*/
"use strict";

/**
 * Converts a string to Propercase (lower case with leading cap).
 * @method adventurejs.Game#propercase
 * @memberOf adventurejs.Game
 * @param {String} string
 * @returns {String}
 */
adventurejs.propercase = function Adventurejs_propercase(string) {
  if ("string" !== typeof string) return "";
  string = string.toLowerCase();
  string = string.charAt(0).toUpperCase() + string.substring(1);
  return string;
};