Any character string.
A string containing the one character to be found.
The position of the char_as_string within the string, where the first character is in position zero. If the char_as_string is not found in the string, returns -1. strchr returns the first occurrence of the character in the string. strrchr returns the last occurrence of the character in the string.
These functions search a string for an individual character and return the first or last occurrence of that character within the string. The characters within a string are numbered starting at zero.
Gamma> strchr("apple","a");
0
Gamma> strchr("apple","r");
-1
Gamma> strchr("apple","p");
1
Gamma> strrchr("apple pie","p");
6
Gamma>