function titleCase(str) {
var str1 = str.toLowerCase().replace(/\b(\w|')+\b/g, function(str){
return str.substring(0,1).toUpperCase()+str.substring(1);
}
);
return str1;
}
/*
/\b(\w|')+\b/g
*/
Created
August 29, 2016 15:50
-
-
Save GeekaholicLin/b7b77972172fe294406bf67f90b096fb to your computer and use it in GitHub Desktop.
transfer the title of all the worlds in the sentence to uppercase
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment