function camelCase(str) {
    // Replace special characters with a space
    str = str.replace(/[^a-zA-Z0-9 ]/g, ' ');
    // put a space before an uppercase letter
    str = str.replace(/([a-z](?=[A-Z]))/g, '$1 ');
    // Lower case first character and some other stuff
    str = str.replace(/([^a-zA-Z0-9 ])|^[0-9]+/g, '').trim().toLowerCase();
    // uppercase characters preceded by a space or number
    str = str.replace(/([ 0-9]+)([a-zA-Z])/g, function (a, b, c) {
        return b.trim() + c.toUpperCase();
    });
    return str;
}
function camelCase(str) {
    // Replace special characters with a space
    str = str.replace(/[^a-zA-Z0-9 ]/g, ' ');
    // put a space before an uppercase letter
    str = str.replace(/([a-z](?=[A-Z]))/g, '$1 ');
    // Lower case first character and some other stuff
    str = str.replace(/([^a-zA-Z0-9 ])|^[0-9]+/g, '').trim().toLowerCase();
    // uppercase characters preceded by a space or number
    str = str.replace(/([ 0-9]+)([a-zA-Z])/g, function (a, b, c) {
        return b.trim() + c.toUpperCase();
    });
    return str;
}
function camelCase ( str ) { // Replace special characters with a space str = str . replace ( / [^a-zA-Z0-9 ] / g , ' ' ) ; // put a space before an uppercase letter str = str . replace ( / ([a-z](?=[A-Z])) / g , '$1 ' ) ; // Lower case first character and some other stuff str = str . replace ( / ([^a-zA-Z0-9 ])|^[0-9]+ / g , '' ) . trim ( ) . toLowerCase ( ) ; // uppercase characters preceded by a space or number str = str . replace ( / ([ 0-9]+)([a-zA-Z]) / g , function ( a , b , c ) { return b . trim ( ) + c . toUpperCase ( ) ; } ) ; return str ; }
Converts strings from something to camel case
http://stackoverflow.com/questions/10425287/convert-dash-separated-string-to-camelcase
Converts strings from something to camel case http : // stackoverflow . com / questions / 10425287 / convert - dash - separated - string - to - camelcase
Convert a string to camelCase