Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic


The functions strcmp(), stricmp(), strncmp() and strnicmp() do string comparisons. They return 0 when the strings match, -1 when the source string is sorted before the comparison string, and 1 when the source string is sorted after the target string. stricmp() and strnicmp() do case insensitive comparisons. strncmp() and strnicmp() limit the comparison to the first N bytes. If a UTF-8 character uses more than one byte, such as "é", increase N accordingly. For example, "strncmp( name, \"Pelé\", 5 ) == 0". Lastly, strncmp() is the same as strncmp().

In This Section

Exact string matches

Case insensitive matches

Partial matches

Case insensitive partial matches

Contains Matches

Wildcard Matches

Case insensitive wildcard Matches

Compare string fields in the same record