Skip to content

@longmo-utils/common / camelCase

Function: camelCase()

ts
function camelCase(str): string;

将字符串转换为驼峰命名

Parameters

ParameterTypeDescription
strstring输入字符串

Returns

string

驼峰命名字符串

Example

ts
camelCase('hello-world') // 'helloWorld'
camelCase('hello_world') // 'helloWorld'
camelCase('hello world') // 'helloWorld'

Released under the MIT License.