Format
#include <wcstr.h> wchar_t *wcspbrk(const wchar_t *string1, const wchar_t *string2);
Language Level: XPG4
wcspbrk locates the first occurrence in the string pointed to by string1
of any wide character from the string pointed to by string2.
Return Value
wcspbrk returns a pointer to the character. If string1
and string2 have no wide characters in common, wcspbrk
returns NULL.
Example
This example uses wcspbrk to find the first occurrence
of either a or b in the array string.
#include <stdio.h> #include <wcstr.h>
int main(void)
{
wchar_t * result;
wchar_t * string = L"The Blue Danube";
wchar_t *chars = L"ab";
result = wcspbrk( string, chars);
printf("The first occurrence of any of the characters \"%ls\" in "
"\"%ls\" is \"%ls\"\n", chars, string, result);
return 0;
/*************************************************************************
The output should be:
The first occurrence of any of the characters "ab" in "A Blue Danube"
is "anube"
************************************************************************/
}
![]()
strchr -- Search for Character
strcspn -- Compare Strings for
Substrings
strpbrk -- Find Characters in String
strrchr -- Find Last Occurrence of
Character in String
strspn -- Search Strings
wcschr -- Search for Wide Character
wcscmp -- Compare Wide-Character
Strings
wcscspn -- Find Offset of First
Wide-Character Match
wcsncmp -- Compare Wide-Character
Strings
wcsrchr -- Locate Wide Character in
String
wcsspn -- Search Wide-Character
Strings
wcswcs -- Locate Wide-Character
Substring
<wcstr.h>