5 lines
185 B
JavaScript
5 lines
185 B
JavaScript
function unCapitalizeWords(str)
|
|
{
|
|
return str.replace(/\w\S*/g, function(txt){return txt.substr(0).toLowerCase();});
|
|
}
|
|
console.log(unCapitalizeWords('JS STRING EXERCISES')); |