function toTitleCase(string) {
  if (typeof string !== 'string') {
    return string;
  }

  return string.charAt(0).toUpperCase() + string.slice(1);
}
Convert string to title case.

@param {string} string - the string to convert
@return {string} the returned titlecase string