Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript convert uppercase to lowercase and vice-versa Reply To: convert uppercase to lowercase and vice-versa

#252910
Mottie
Member

Update: There is a limitation of the above code… lower-case letters with diacritics will not be modified. You would need to include all lower case unicode characters, which isn’t as simple as it sounds because you can’t add a simple range into the regular expression because upper & lower case letters alternate (ref).

Here is a demo that includes a lesser subset of diacritics which only requires the change of this line:

var lc = /[a-zàèìòùáéíóúýâêîôûãñõäëïöüÿçßøåæœ]/;