User manual

Table Of Contents
626
mikoC PRO for PIC32
MikroElektronika
strpbrk
Prototype
char *strpbrk(char * s1, char *s2);
Description Function searches s1 for the rst occurrence of any character from the string s2. The terminating null
character is not included in the search. The function returns pointer to the matching character in s1. If
s1 contains no characters from s2, the function returns 0.
Example
char txt = “mikroElektronika”;
char txt_sub = “mikro”;
char *res;
res = strpbrk(txt_sub,txt);
strrchr
Prototype
char *strrchr(char * ptr, char chr);
Description Function searches the string ptr for the last occurrence of character chr. The null character
terminating ptr is not included in the search. The function returns pointer to the last chr found in
ptr; if no matching character was found, function returns 0.
Example
char txt = “mikroElektronika”;
res = strrchr(txt_sub,’k’); // returns the pointer to the ‘k’ character of
the ‘txt’ string