Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var str = "hello world";
str = str.toLowerCase().replace(/\b[a-z]/g, function(letter) {
return letter.toUpperCase();
});
alert(str); //Displays "Hello World"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment