1strcoll(3)                 Library Functions Manual                 strcoll(3)
2
3
4

NAME

6       strcoll - compare two strings using the current locale
7

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

12       #include <string.h>
13
14       int strcoll(const char *s1, const char *s2);
15

DESCRIPTION

17       The  strcoll() function compares the two strings s1 and s2.  It returns
18       an integer less than, equal to, or greater than zero if  s1  is  found,
19       respectively,  to  be  less than, to match, or be greater than s2.  The
20       comparison is based on strings interpreted as appropriate for the  pro‐
21       gram's current locale for category LC_COLLATE.  (See setlocale(3).)
22

RETURN VALUE

24       The  strcoll()  function  returns  an  integer  less than, equal to, or
25       greater than zero if s1 is found, respectively, to  be  less  than,  to
26       match,  or be greater than s2, when both are interpreted as appropriate
27       for the current locale.
28

ATTRIBUTES

30       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
31       tributes(7).
32
33       ┌─────────────────────────────────────┬───────────────┬────────────────┐
34Interface                            Attribute     Value          
35       ├─────────────────────────────────────┼───────────────┼────────────────┤
36strcoll()                            │ Thread safety │ MT-Safe locale │
37       └─────────────────────────────────────┴───────────────┴────────────────┘
38

STANDARDS

40       C11, POSIX.1-2008.
41

HISTORY

43       POSIX.1-2001, C89, SVr4, 4.3BSD.
44

NOTES

46       In the POSIX or C locales strcoll() is equivalent to strcmp(3).
47

SEE ALSO

49       memcmp(3),    setlocale(3),    strcasecmp(3),   strcmp(3),   string(3),
50       strxfrm(3)
51
52
53
54Linux man-pages 6.04              2023-03-30                        strcoll(3)
Impressum