const myWord = "ölkorv";
myWord.replace(/\w\S*/g, function(txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});
This returns: "öLkorv". So basicly I understand that \w
will only match on latin letters, how would I accomplish the same thing but allow of ÅÄÖ?