Search for the first occurrence of the character ch in the string str.

Search for the first occurrence of the character ch in the string str. The function returns a pointer to the point in the string where the searched character occurs for the first time. If the character is not found, the call returns 0. To ascertain the last position of a character in a string use the strchrpos function.

Name Type Default Description
Return char*   Pointer to the first occurrence of the character ch in the string str.
0 : The character was not found
str char* - Character string which is to be searched
ch char - Search for this character. Must not be equal to 0.
strcpy (str, "Matthias");
strchr (str, 't') returns "tthias"

Since
Version 1.2.1 (12 September 2005)

Available
priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator

See Also
strchrpos
strstr
strstrpos

Alphabetic index HTML hierarchy of classes or Java