Loading...
Select Version
&pagelevel(4)&pagelevel
Definition | #include <string.h> char *strpbrk(const char *s1, const char *s2);
| |
Return val. | Pointer to the first matching character found in s1 | |
if successful. | ||
NULL pointer | if not a single match is present. | |
Notes | Strings terminated with the null byte (\0) are expected as arguments. The following two prototypes of the char *strpbrk( char *s1, const char *s2); | |
Example | #include <string.h>
#include <stdio.h>
int main(void)
{
char text1[40];
static char text2[] = "0123456789";
char *result;
printf("Example of strpbrk()\n");
printf("Please enter a string (max. 40 characters) !\n");
scanf("%s",text1);
result = strpbrk(text1,text2);
if(result == NULL)
printf("The entered string does not contain any digits.\n");
else printf("%s\n", result);
return 0;
}
| |
See also | index, strchr | |