StrChrA function (shlwapi.h)

Searches a string for the first occurrence of a character that matches the specified character. The comparison is case-sensitive.

Syntax

PCSTR StrChrA(
  [in] PCSTR pszStart,
       WORD  wMatch
);

Parameters

[in] pszStart

Type: PTSTR

The address of the string to be searched.

wMatch

Type: TCHAR

The character to be used for comparison.

Return value

Type: PTSTR

Returns the address of the first occurrence of the character in the string if successful, or NULL otherwise.

Remarks

The comparison assumes pszStart points to the start of a null-terminated string.

Note

The shlwapi.h header defines StrChr as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

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