upperCase

Convert a string to UPPERCASE words separated by single spaces, splitting camelCase, snake_case, and kebab-case input first.

Usage

Converts a string to uppercase format with words separated by spaces.

import { upperCase } from '@movk/core'

upperCase('firstName') // => 'FIRST NAME'
upperCase('first_name') // => 'FIRST NAME'
upperCase('first-name') // => 'FIRST NAME'
upperCase('XMLHttpRequest') // => 'XML HTTP REQUEST'

API

upperCase(str: string): string

Parameters

str
string required
The string to convert.

Returns

string
Returns the string in uppercase format.

Changelog

No recent changes
Copyright © 2024 - 2026 YiXuan - MIT License