Function

GLibascii_strncasecmp

Declaration [src]

gint
g_ascii_strncasecmp (
  const gchar* s1,
  const gchar* s2,
  gsize n
)

Description [src]

Compare s1 and s2, ignoring the case of ASCII characters and any characters after the first n in each string.

Unlike the BSD strcasecmp() function, this only recognizes standard ASCII letters and ignores the locale, treating all non-ASCII characters as if they are not letters.

The same warning as in g_ascii_strcasecmp() applies: Use this function only on strings known to be in encodings where bytes corresponding to ASCII letters always represent themselves.

Parameters

s1 const gchar*
 

String to compare with s2

 The data is owned by the caller of the function.
 The string is a NUL terminated UTF-8 string.
s2 const gchar*
 

String to compare with s1

 The data is owned by the caller of the function.
 The string is a NUL terminated UTF-8 string.
n gsize
 

Number of characters to compare.

Return value

Returns: gint
 

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