losaremote.blogg.se

String contains js
String contains js





It provides a special method to compare strings in different languages, following their rules. Luckily, modern browsers support the internationalization standard ECMA-402. So, the browser needs to know the language to compare. The “right” algorithm to do string comparisons is more complex than it may seem, because alphabets are different for different languages. Here, its code is greater than anything from a to z.

string contains js

  • Some letters like Ö stand apart from the main alphabet.
  • All lowercase letters go after uppercase letters because their codes are greater.
  • The code for a (97) is greater than the code for Z (90).

    string contains js

    The greater code means that the character is greater.

    string contains js

    The characters are compared by their numeric code.







    String contains js