Javascript: Convert proper name to Capital/Title Case

1
2
String.prototype.toTitleCase = function () {
return this.toLowerCase().replace(/[^\s|\'\-]+/g, function(word) {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Get proper names in Capital Case format:

example:

ÓLIVER DE LAS CASAS PIÑERO => Óliver De Las Casas Piñero

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.