toUpper.js 592 B

1234567891011121314151617181920212223242526272829
  1. var toString = require('./toString');
  2. /**
  3. * Converts `string`, as a whole, to upper case just like
  4. * [String#toUpperCase](https://mdn.io/toUpperCase).
  5. *
  6. * @static
  7. * @memberOf _
  8. * @since 4.0.0
  9. * @category String
  10. * @param {string} [string=''] The string to convert.
  11. * @returns {string} Returns the upper cased string.
  12. * @example
  13. *
  14. * _.toUpper('--foo-bar--');
  15. * // => '--FOO-BAR--'
  16. *
  17. * _.toUpper('fooBar');
  18. * // => 'FOOBAR'
  19. *
  20. * _.toUpper('__foo_bar__');
  21. * // => '__FOO_BAR__'
  22. */
  23. function toUpper(value) {
  24. return toString(value).toUpperCase();
  25. }
  26. module.exports = toUpper;