---
title: "camelCase"
description: "Convert a string to camelCase, lowercasing the first word and capitalizing the rest, with no separators between joined words."
canonical_url: "https://core.mhaibaraai.cn/en/docs/transformers/string/camel-case"
---
# camelCase

> Convert a string to camelCase, lowercasing the first word and capitalizing the rest, with no separators between joined words.

## Usage

Converts a string to camelCase format (first word lowercased, subsequent words capitalized).

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

camelCase('First Name') // => 'firstName'
camelCase('first_name') // => 'firstName'
camelCase('first-name') // => 'firstName'
camelCase('XMLHttpRequest') // => 'xmlHttpRequest'
```

## API

`camelCase(str: string): string`

### Parameters

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

### Returns

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

## Changelog

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

---

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


## Sitemap

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