strcoll

Compares two strings using the collating sequence of the current locale

Local Servers:nonblocking
Remote Servers:N/A
Classification:ANSI
Service:String Manipulation

Syntax

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

Parameters

s1
(IN) Points to the string to be compared to the string pointed to by s2.
s2
(IN) Points to the string to be compared to the string pointed to by s1.

Return Values

The strcoll function returns an integer less than, equal to, or greater than 0, indicating that the string pointed to by s1 is less than, equal to, or greater than the string pointed to by s2, according to the collating sequence selected.

Remarks

The strcoll function compares the string pointed to by s1 to the string pointed to by s2. The comparison uses the collating sequence selected by setlocale. The function is equivalent to strcmp when the collating sequence is selected from the "C" locale.

See Also

NWLstrcoll, NWLsetlocale, setlocale (Internationalization), strcmp

Example

  #include <string.h>  
   
  main ()  
  {  
     char   buffer[80];  
     if (strcoll (buffer, "Hello") < 0)  
        printf ("Less than\n");  
  }