Pointer to the null-terminated string to be searched.
2nd Parameter Type : const char *
Pointer to read-only string
2nd Parameter
Pointer to the null-terminated string containing the characters to match in `str1`.
Read more about parameters of strpbrk in parameters section
The strpbrkfunction in C language Searches a string for the first occurrence of any of the characters in a specified string.
The strpbrk function locates the first occurrence in the string pointed to by s1 of any character from the string pointed to by s2. The terminating null characters are not compared.
The strpbrkfunction takes 2
parameters:
•
const char * `str1`: Pointer to the null-terminated string to be searched.
•
const char * `str2`: Pointer to the null-terminated string containing the characters to match in `str1`.
Searches the string `str1` for the first occurrence of any character present in the string `str2`. Returns a pointer to the first occurrence in `str1` of any character from `str2`, or `NULL` if no such character is found.
The strpbrk function return value :
Returns a pointer to the character in s1 that matches one of the characters in s2, or NULL if no such character is found
Output
This example uses strpbrk to find the first vowel in a string.