---
title: "upperCase"
description: "Convert a string to UPPERCASE words separated by single spaces, splitting camelCase, snake_case, and kebab-case input first."
canonical_url: "https://core.mhaibaraai.cn/en/docs/transformers/string/upper-case"
---
# 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.

```ts
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

See commit history for [src/transformers/string/upperCase.ts](https://github.com/mhaibaraai/movk-core/commits/main/src/transformers/string/upperCase.ts).

---

- [GitHub](https://github.com/mhaibaraai/movk-core/blob/main/src/transformers/string/upperCase.ts)


## Sitemap

See the full [sitemap](https://core.mhaibaraai.cn/sitemap.md) for all pages.
