I was searching for a solution to capitalize first letter of each word in a string and i got solution from stack overflow.
function convert_case(str) {
var lower = str.toLowerCase();
return lower.replace(/(^| )(\w)/g, function(x) {
return x.toUpperCase();
});
}
This code works. But i didn't understood what this code means? Any one please describe it.