---
title: "upperCase"
description: "将字符串转换为全大写，单词间用空格分隔 (HELLO WORLD)。"
seo_title: "upperCase"
seo_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/docs/transformers/string/upper-case"
---
# upperCase

> 将字符串转换为全大写，单词间用空格分隔 (HELLO WORLD)。

## 用法

将字符串转换为大写格式，单词之间用空格分隔。

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

### 参数

**str** (`string`) *required*: 要转换的字符串。

### 返回值

**string**: 返回大写格式的字符串。

## Changelog

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


## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
