Search code examples
javascriptuppercase

How can I get uppercase of a string in Javascript?


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?


Solution

  • You would use toUpperCase():

    console.log('ñç'.toUpperCase());