mirror of
https://github.com/toss/es-toolkit.git
synced 2024-11-24 03:32:58 +03:00
704 B
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'