totn C Functions

C Language: strpbrk function
(Search String for One of a Set of Characters)

In the C Programming Language, the strpbrk function searches within the string pointed to by s1 for any character in the string pointed to by s2.

Syntax

The syntax for the strpbrk function in the C Language is:

char *strpbrk(const char *s1, const char *s2);

Parameters or Arguments

s1
A string to search within.
s2
The string that you want to find.

Returns

The strpbrk function returns a pointer to the leftmost matching character in the string pointed to by s1 that matches any character in the string pointed to by s2. If no match is found, it returns a null pointer.

Required Header

In the C Language, the required header for the strpbrk function is:

#include <string.h>

Applies To

In the C Language, the strpbrk function can be used in the following versions:

  • ANSI/ISO 9899-1990

See Also

Other C functions that are noteworthy when dealing with the strpbrk function: