Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer


This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Searches for the last occurrence of a character in a null-terminated string.

Header file:


Implemented by:


Called by:

Client applications and service providers

LPTSTR SzFindLastCh(
  LPCTSTR lpsz,


[in] Pointer to the null-terminated string to be searched.


[in] The character to be searched for.

SzFindLastCh returns a pointer to the last occurrence of the character in the string. If the character does not occur anywhere in the string, or if the lpsz parameter is NULL, a value of NULL is returned.

The SzFindLastCh function searches for an exact match only; it is sensitive to case and diacritical differences. Searches in the Unicode and DBCS formats are supported.

© 2015 Microsoft