📜  js camelcase - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:07.344000             🧑  作者: Mango

代码示例3
function toCamelCase(str) {
    return str
        .replace(/\s(.)/g, function($1) { return $1.toUpperCase(); })
        .replace(/\s/g, '')
        .replace(/^(.)/, function($1) { return $1.toLowerCase(); });
}