es-toolkit/docs/reference/string/upperCase.md
mattiacoll 7f2e19dc31
Some checks are pending
CI / codecov (push) Waiting to run
Release / release (push) Waiting to run
feat: add upperCase function (#402)
* feat(upperCase): Add upperCase function

* Add upperCase benchmark

* Added english docs
2024-09-13 15:34:16 +09:00

704 B

upperCase

Converts a string to upper case.

Upper case is the naming convention in which each word is written in uppercase and separated by an space ( ) character. For example, UPPER CASE.

Signature

function upperCase(str: string): string;

Parameters

  • str (string): The string that is to be changed to upper case.

Returns

(string) The converted string to upper case.

Examples

import { upperCase } from 'es-toolkit/string';

upperCase('camelCase'); // returns 'CAMEL CASE'
upperCase('some whitespace'); // returns 'SOME WHITESPACE'
upperCase('hyphen-text'); // returns 'HYPHEN TEXT'
upperCase('HTTPRequest'); // returns 'HTTP REQUEST'