Skip to content

to camel case

Subhajit Sahu edited this page May 5, 2020 · 1 revision

Convert string to camel case.

const toCamelCase = require('@extra-string/to-camel-case');
// toCamelCase(<string>, [capitalize=0], [separator=/\W+/g])

toCamelCase('Western Ghats');
// 'westernGhats'
toCamelCase('cardamom--hills', 1);
// 'CardamomHills'
toCamelCase('EAstErn__ghAts', 1, '_');
// 'EasternGhats'

extra-string

Clone this wiki locally