---
title: "pascalCase"
description: "Convert a string to PascalCase, capitalizing each word and removing separators, ideal for type, class, and component names."
canonical_url: "https://core.mhaibaraai.cn/en/docs/transformers/string/pascal-case"
---
# pascalCase

> Convert a string to PascalCase, capitalizing each word and removing separators, ideal for type, class, and component names.

## Usage

Converts a string to PascalCase format (each word capitalized with no separators).

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

pascalCase('firstName') // => 'FirstName'
pascalCase('first_name') // => 'FirstName'
pascalCase('first-name') // => 'FirstName'
pascalCase('XMLHttpRequest')// => 'XmlHttpRequest'
```

## API

`pascalCase(str: string): string`

### Parameters

**str** (`string`) *required*: The string to convert.

### Returns

**string**: Returns the string in PascalCase format.

## Changelog

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

---

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


## Sitemap

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