GLib.ascii_strcasecmp
function ascii_strcasecmp(s1: String, s2: String): Number(gint) { // Gjs wrapper for g_ascii_strcasecmp() }
Compare two strings, ignoring the case of ASCII characters.
Unlike the BSD strcasecmp() function, this only recognizes standard ASCII letters and ignores the locale, treating all non-ASCII bytes as if they are not letters.
This function should be used only on strings that are known to be in encodings where the bytes corresponding to ASCII letters always represent themselves. This includes UTF-8 and the ISO-8859-* charsets, but not for instance double-byte encodings like the Windows Codepage 932, where the trailing bytes of double-byte characters include all ASCII letters. If you compare two CP932 strings using this function, you will get false matches.
Both s1 and s2 must be non-null.
- s1
string to compare with s2
- s2
string to compare with s1
- Returns
0 if the strings match, a negative value if s1 < s2, or a positive value if s1 > s2.