Skip to content

Instantly share code, notes, and snippets.

@lionelB
Last active December 16, 2015 20:50
Show Gist options
  • Save lionelB/5495734 to your computer and use it in GitHub Desktop.
Save lionelB/5495734 to your computer and use it in GitHub Desktop.
function capitalize(str) {
return str.replace(/^[a-zàáâãäåçèéêëìíîïðòóôõöùúûüýÿñ]/, function(x) {
return String.fromCharCode(x.charCodeAt(0) - 32);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment