toCamelCase

toCamelCase

Converts any casing to camelCase

Import

import { toCamelCase } from '@fullstacksjs/toolbox';

Signature

function camelCaseTransform(input: string, index: number) {}

Examples

toCamelCase('')             // ''
toCamelCase(' ')            // ''
toCamelCase('foo')          // 'foo'
toCamelCase('foo bar')      // 'fooBar'
toCamelCase('foo-bar')      // 'fooBar'
toCamelCase('fooBar')       // 'fooBar'
toCamelCase('foo_bar')      // 'fooBar'
toCamelCase('foo bar code') // 'fooBarCode'
toCamelCase('foo-bar-code') // 'fooBarCode'
toCamelCase('fooBarCode')   // 'fooBarCode'
toCamelCase('foo_bar_code') // 'fooBarCode'
toCamelCase('FOO_BAR_CODE') // 'fooBarCode'
toCamelCase('ThisIs-fullstacksjs radio__and--I-loveCoding') // 'thisIsFullstacksjsRadioAndILoveCoding'