Str.asciiStrcasecmp

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.

class Str
static
int
asciiStrcasecmp
(
string s1
,
string s2
)

Parameters

s1 string

string to compare with s2.

s2 string

string to compare with s1.

Return Value

Type: int

0 if the strings match, a negative value if s1 < s2, or a positive value if s1 > s2.

Meta