#include <string.h> char *strpbrk(char *s1, const char *s2);
finds the first occurrence of a character.
#include <stdio.h> /* including standard library */ //#include <windows.h> /* uncomment this for Windows */ #include <string.h> int main( void ) { char string1[]="You can help with your experience to improve this page"; char string2[]="help"; printf("So please %s\n", strpbrk( string1, string2 ) ); return 0; }
Output:
user@host:~$ ./strpbrk So please help with your experience to improve this page