JS snake_case to Capital Case
function snakeToCapitalCase(string){
var parts = string.split('_');
for(var i = 0; i < parts.length; i++){
parts[i] = parts[i].charAt(0).toUpperCase() + parts[i].substring(1).toLowerCase();
console.log(parts[i]);
}
return parts.join(' ');
}
Written by Alex Lockwood
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Related Tags
#javascript
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#