Last Updated: February 25, 2016
·
237
· alockwood05

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(' ');
}