---
title: "startCase"
description: "将字符串转换为标题式 (Hello World)。"
seo_title: "startCase"
seo_description: "Convert a string to Start Case, capitalizing each word and separating them with spaces, ideal for readable titles and headings."
canonical_url: "https://core.mhaibaraai.cn/docs/transformers/string/start-case"
---
# startCase

> 将字符串转换为标题式 (Hello World)。

## 用法

将字符串转换为Start Case格式（每个单词首字母大写，用空格分隔）。

```ts
import { startCase } from '@movk/core'

startCase('firstName') // => 'First Name'
startCase('first_name') // => 'First Name'
startCase('first-name') // => 'First Name'
startCase('XMLHttpRequest') // => 'XML Http Request'
```

## API

`startCase(str: string): string`

### 参数

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

### 返回值

**string**: 返回标题式格式的字符串。

## Changelog

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


## Sitemap

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