GuobaGuoba Utils

camel

@guoba-ai/utils / string / camel

Function: camel()

function camel(str): string;

Defined in: string.ts:115

Convert a string to camelCase.

Parameters

str

string

The string to convert

Returns

string

The camelCase version of the string

Example

camel('foo-bar') // 'fooBar'

camel('FooBar') // 'fooBar'

camel('foo_bar') // 'fooBar'

Warning

Conversion follows the current word-splitting rules for separators, casing, and acronyms.

On this page