StrCmpICA function

Compares two strings using C run-time (ASCII) collation rules. The comparison is not case-sensitive.

Syntax

int StrCmpICA(
  LPCSTR pszStr1,
  LPCSTR pszStr2
);

Parameters

pszStr1

Type: LPCTSTR

A pointer to the first null-terminated string to be compared.

pszStr2

Type: LPCTSTR

A pointer to the second null-terminated string to be compared.

Return Value

Type: int

Returns zero if the strings are identical. Returns a positive value if the string pointed to by lpStr1 is alphabetically greater than that pointed to by lpStr2. Returns a negative value if the string pointed to by lpStr1 is alphabetically less than that pointed to by lpStr2

Remarks

It is strongly recommended that you use CompareString in place of this function. StrCmpIC was designed for comparing canonical strings. These strings are not localized and consist only of characters below ASCII value 128. Therefore, it will not function correctly with double-byte character set (DBCS) data.

Uppercase characters are converted to lowercase characters before comparing, and the return value is based on comparing the converted values. This function returns the difference in value of the first unequal characters it encounters, or zero if they are all equal. For example, if lpStr1="abczb" and lpStr2="abcdefg", StrCmpIC determines that "abczb" is greater than "abcdefg" and returns z - d.

For those versions of Windows that do not include StrCmpIC in Shlwapi.h, this function's individual ANSI or Unicode version must be called directly from Shlwapi.dll. StrCmpICA is ordinal 157 and StrCmpICW is ordinal 158.

Requirements

   
Minimum supported client Windows 2000 Professional, Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header shlwapi.h
Library Shlwapi.lib
DLL Shlwapi.dll (version 5.0 or later)

See Also

CompareString