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).

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

No recent changes
Copyright © 2024 - 2026 YiXuan - MIT License