DEV Community

Discussion on: Javascript String Methods You Must Know to Become an Algorithms Wizard

Collapse
 
mattmcmahon profile image
Matt McMahon • Edited

Great introduction, Mauro!

Sometimes string manipulation can go wrong in strange ways. So it's good to know that there are alternative versions for some of these methods.

For example, the toLocalUpperCase and toLocalLowerCase methods property capitalize languages (other than, e.g., English) which can have some unexpected casing rules.

Also, some Unicode glyphs need multiple character codes. If you're working with languages (and not hashing or encoding), you may want to reach for the codePointAt method, which handles this type of glyph correctly. If splitting or reversing a string isn't working as you'd expect, keep this method in mind.

Depending on your audience and local, you may never need to reach for these methods. As your audience grows, though, using them can solve a number of strange and hard to understand bugs in string manipulation.

Cheers!

Collapse
 
uptheirons78 profile image
Mauro Bono

Thanks for the useful reply. This post is meant to be an introduction of the methods I used more on solving coding problems, but I am surely going to integrate it even with your suggestions. Have a nice day!