djake1680
7/30/2018 - 7:29 PM

JS - Capitalize All Words In String

        function capitalizeWords(string) {
            let splitString = string.split("_");
            let outputString = "";
            for(let i = 0; i <  splitString.length; i++) {
                outputString += splitString[i].charAt(0).toUpperCase() + splitString[i].slice(1) + " ";
            }
            return outputString;
        }