locate an occurrence of one string in another
#include <string.h>
char *strpbrk( const char *str,
const char *charset );
char __far *_fstrpbrk( const char __far *str,
const char __far *charset );
The strpbrk() function locates the first occurrence in the string pointed to by str of any character from the string pointed to by charset.
The _fstrpbrk() function is a data-model-independent form of the strpbrk() function. It accepts far pointer arguments, and returns a far pointer. It is most useful in mixed memory model applications.
A pointer to the located character, or NULL if no character from charset occurs in str.
#include <stdio.h>
#include <string.h>
void main()
{
char *p = "Find all vowels";
while( p != NULL ) {
printf( "%s\n", p );
p = strpbrk( p+1, "aeiouAEIOU" );
}
}
produces the output:
Find all vowels ind all vowels all vowels owels els
| Safety: | |
|---|---|
| Interrupt handler | Yes |
| Signal handler | Yes |
| Thread | Yes |