strpbrk, _fstrpbrk

locate an occurrence of one string in another

Synopsis:

#include <string.h>
char *strpbrk( const char *str,
               const char *charset );
char __far *_fstrpbrk( const char __far *str,
                       const char __far *charset );

Description:

The strpbrk() and _fstrpbrk() functions locate 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.

Returns:

a pointer to the located character, or NULL if no character from charset occurs in str

See also:

strchr(), strrchr(), strtok()

Examples:

#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

Classification:

strpbrk() is ANSI; _fstrpbrk() is WATCOM.

Systems:

strpbrk()
All (except DOS/PM)
_fstrpbrk()
All (except Netware, DOS/PM)