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

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