str_cmp (STRING* string1,
STRING* string2)
Compares two strings case sensitive.
str_cmpi (STRING* string1,
STRING* string2)
Compares two strings without case sensitivity
str_cmpni (STRING* string1,
STRING* string2)
Compares the beginning of two strings without case sensitivity;
only the number of characters of the shorter string is compared.
Parameters:
string1 - string to be compared,
char* or STRING*
string2 - string to be compared, char* or STRING*
Returns:
1 - string1 equal to string2
0 - string1 different from string2
Speed:
Fast
Remarks:
- These functions return 1 if the strings are equal. This is different
to C / C++ where similar functions
return 0 when the strings are equal.
-
Either both or none of the strings
must contain Unicode.
Example:
STRING* s1 = "hello world";
STRING* s2 = "Hello World";
...
str_cmp(s1,"hello world"); // returns 1
str_cmp(s2,"hello world"); // returns 0
str_cmpi(s1,"hello world"); // returns 1
str_cmpni(s2,"Hello"); // returns 1
See also:
str_cpy, str_cat, str_len, str_clip, str_trunc, str_stri
► latest
version online