版博士V2.0程序
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

23 linhas
459 B

  1. /**
  2. * @fileoverview Utilities to operate on strings.
  3. * @author Stephen Wade
  4. */
  5. "use strict";
  6. /**
  7. * Converts the first letter of a string to uppercase.
  8. * @param {string} string The string to operate on
  9. * @returns {string} The converted string
  10. */
  11. function upperCaseFirst(string) {
  12. if (string.length <= 1) {
  13. return string.toUpperCase();
  14. }
  15. return string[0].toUpperCase() + string.slice(1);
  16. }
  17. module.exports = {
  18. upperCaseFirst
  19. };