Converting any string into camel case
How can I convert a string into camel case using javascript regex? EquipmentClass name or Equipment className or equipment class name or Equipment Class Name should all become: equipmentClassName. 41 Answers 41 Looking at your code, you can achieve it with only two replace calls: function camelize(str) { return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) { return index … Read more