Keil Logo

strpbrk

Summary
#include <string.h>

unsigned char *strpbrk (
  const unsigned char *string,   /* string to search */
  const unsigned char *set);     /* characters to find */
Description

The strpbrk function searches string for the first occurrence of any character from set. The null terminator is not included in the search.

Return Value

The strpbrk function returns a pointer to the matching character in string. If string contains no characters from set, a null pointer is returned.

See Also

strchr, strcspn, strpos, strrchr, strrpbrk, strrpos, strspn

Example
#include <string.h>
#include <stdio.h> /* for printf */

void tst_strpbrk (void)
{
unsigned char vowels [] ="AEIOUaeiou";
unsigned char text [] = "Seven years ago...";
unsigned char *p;

p = strpbrk (text, vowels);

if (p == NULL)
  printf ("No vowels found in %s\n", text);
else
  printf ("Found a vowel at %s\n", p);
}
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.