I need to get the uppercase (or lowercase) of a string in Javascript, but that string can contain special characters of any alphabet in UTF-8 (for example, spanish ñ or ç, german ä, ö or ü, etc.).
How can I get this?
Paolo
15.9k28 gold badges73 silver badges95 bronze badges
asked Feb 27, 2017 at 8:59
1 Answer 1
You would use toUpperCase():
console.log('ñç'.toUpperCase());
answered Feb 27, 2017 at 9:08
Sign up to request clarification or add additional context in comments.
Comments
lang-js
.toUpperCase()?.toLocaleUpperCase(), but it uses the current locale; you can’t set it.