stricmp

Compares, with case insensitivity, two strings

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

Syntax

  #include <string.h>  
   
  int stricmp  (  
     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 stricmp function returns an integer less than, equal to, or greater than zero, indicating that the string pointed to by s1 is less than, equal to, or greater than the string pointed to by s2.

Remarks

The stricmp function compares, with case insensitivity, the string pointed to by s1 to the string pointed to by s2.

See Also

strcmp, strncmp, strnicmp

Example

  #include <string.h> 
    
  main ()  
  {  
     printf ("%d\n", stricmp ("AbCDEF", "abcdef") );  
     printf ("%d\n", stricmp ("abcdef", "ABC") );  
     printf ("%d\n", stricmp ("abc",    "ABCdef") );  
     printf ("%d\n", stricmp ("Abcdef", "nopqr") );  
     printf ("%d\n", stricmp ("Mnopqr", "abcdef") );  
  }
  

produces the following:

  0  
  100  
  -100  
  -12  
  12